Class SectionEntryData

java.lang.Object
org.skriptlang.skript.lang.entry.EntryData<SectionNode>
org.skriptlang.skript.lang.entry.SectionEntryData

public class SectionEntryData extends EntryData<SectionNode>
A simple entry data class for handling SectionNodes.
  • Constructor Details

    • SectionEntryData

      public SectionEntryData(String key, @Nullable SectionNode defaultValue, boolean optional)
  • Method Details

    • getValue

      public @Nullable SectionNode getValue(Node node)
      Because this entry data is for SectionNodes, no specific handling needs to be done to obtain the "value". This method just asserts that the provided node is actually a SectionNode.
      Specified by:
      getValue in class EntryData<SectionNode>
      Parameters:
      node - A SimpleNode to obtain (and possibly convert) the value of.
      Returns:
      The value obtained from the provided SimpleNode.
    • canCreateWith

      public boolean canCreateWith(Node node)
      Checks whether the provided node can be used as the section for this entry data. A check is done to verify that the node is a SectionNode, and that it also meets the requirements of EntryData.canCreateWith(Node).
      Specified by:
      canCreateWith in class EntryData<SectionNode>
      Parameters:
      node - The node to check.
      Returns:
      Whether the provided Node works with this entry data.