Record Class ModelOutliner.Tree

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelOutliner.Tree
Record Components:
group - the group definition
children - the list of child outliner nodes
All Implemented Interfaces:
ModelOutliner
Enclosing interface:
ModelOutliner

public static record ModelOutliner.Tree(@NotNull ModelGroup group, @NotNull @Unmodifiable List<ModelOutliner> children) extends Record implements ModelOutliner
Represents a branch node (Group) in the outliner, containing child nodes.
Since:
1.15.2
  • Constructor Details

    • Tree

      public Tree(@NotNull @NotNull ModelGroup group, @NotNull @NotNull @Unmodifiable List<ModelOutliner> children)
      Creates an instance of a Tree record class.
      Parameters:
      group - the value for the group record component
      children - the value for the children record component
  • Method Details

    • toBlueprint

      @NotNull public @NotNull BlueprintElement toBlueprint(@NotNull @NotNull ModelLoadContext context)
      Description copied from interface: ModelOutliner
      Converts this outliner node into a processed BlueprintElement.
      Specified by:
      toBlueprint in interface ModelOutliner
      Parameters:
      context - the model loading context
      Returns:
      the blueprint element
    • flatten

      @NotNull public @NotNull Stream<ModelOutliner> flatten()
      Description copied from interface: ModelOutliner
      Flattens the outliner tree into a stream of all nodes.
      Specified by:
      flatten in interface ModelOutliner
      Returns:
      a stream of all outliner nodes
    • uuid

      @NotNull public @NotNull String uuid()
      Description copied from interface: ModelOutliner
      Returns the UUID of this outliner node.
      Specified by:
      uuid in interface ModelOutliner
      Returns:
      the UUID string
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • group

      @NotNull public @NotNull ModelGroup group()
      Returns the value of the group record component.
      Returns:
      the value of the group record component
    • children

      @NotNull public @NotNull @Unmodifiable List<ModelOutliner> children()
      Returns the value of the children record component.
      Returns:
      the value of the children record component