Package cloud.commandframework
Class CommandTree.Node<T>
- java.lang.Object
-
- cloud.commandframework.CommandTree.Node<T>
-
- Type Parameters:
T
- Node value type
- Enclosing class:
- CommandTree<C>
public static final class CommandTree.Node<T> extends java.lang.Object
Very simple tree structure
-
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
@NonNull java.util.List<@NonNull CommandTree.Node<@Nullable T>>
getChildren()
Get an immutable copy of the node's child list@NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.Object>
getNodeMeta()
Get the node meta instance@Nullable CommandTree.Node<@Nullable T>
getParent()
Get the parent node@Nullable T
getValue()
Get the node valueint
hashCode()
boolean
isLeaf()
Check if the node is a leaf nodevoid
setParent(@Nullable CommandTree.Node<@Nullable T> parent)
Set the parent nodejava.lang.String
toString()
-
-
-
Method Detail
-
getChildren
public @NonNull java.util.List<@NonNull CommandTree.Node<@Nullable T>> getChildren()
Get an immutable copy of the node's child list- Returns:
- Children
-
isLeaf
public boolean isLeaf()
Check if the node is a leaf node- Returns:
true
if the node is a leaf node, elsefalse
-
getNodeMeta
public @NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.Object> getNodeMeta()
Get the node meta instance- Returns:
- Node meta
-
getValue
public @Nullable T getValue()
Get the node value- Returns:
- Node value
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getParent
public @Nullable CommandTree.Node<@Nullable T> getParent()
Get the parent node- Returns:
- Parent node
-
setParent
public void setParent(@Nullable CommandTree.Node<@Nullable T> parent)
Set the parent node- Parameters:
parent
- new parent node
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-