- Type Parameters:
T- The type of the value returned by this entry data.
public abstract class EntryData<T> extends Object
EntryData is used for defining the different entries of for a
Structure's are a primary user of this system.
Take a look at this example:
command /example: # this is the SectionNode description: this is an example of an entry trigger: # this is also an example of an entry # code goes here (not entry data!)From the above, it can be seen that EntryData is found at the level immediately after a
It can also be seen that entries come in many forms.
In fact, all entries are based upon a
This could be something like a
but it may also be something totally different.
Every entry data class must define a validator-type method for
Nodes, along with
a method of obtaining a value from that
Every entry data instance must contain some sort of key. This key is the main identifier
of an entry data instance within a
Method SummaryModifier and TypeMethodDescription
abstract booleanA method to be implemented by all entry data classes that determines whether the provided node may be used with the entry data type to obtain a value.
abstract @Nullable TObtains a value from the provided node using the methods of this entry data.
getKeypublic String getKey()
- The key that identifies and defines this entry data.
getDefaultValuepublic @Nullable T getDefaultValue()
isOptionalpublic boolean isOptional()
- Whether this entry data must be included within a
getValueObtains a value from the provided node using the methods of this entry data.
node- The node to obtain a value from.
- The value obtained from the provided node.
canCreateWithpublic abstract boolean canCreateWith
(Node node)A method to be implemented by all entry data classes that determines whether the provided node may be used with the entry data type to obtain a value.
node- The node to check.
- Whether the provided node may be used with this entry data to obtain a value.