Record Class CachedModelHierarchy

java.lang.Object
java.lang.Record
dev.gothickit.zenkit.mdh.CachedModelHierarchy
All Implemented Interfaces:
CacheableObject<CachedModelHierarchy>, ModelHierarchy

public record CachedModelHierarchy(@NotNull AxisAlignedBoundingBox bbox, @NotNull AxisAlignedBoundingBox collisionBbox, @NotNull Vec3f rootTranslation, long checksum, @NotNull Calendar sourceDate, @NotNull String sourcePath, @NotNull List<@NotNull ModelHierarchyNode> nodes) extends Record implements ModelHierarchy
  • Constructor Details

    • CachedModelHierarchy

      public CachedModelHierarchy(@NotNull @NotNull AxisAlignedBoundingBox bbox, @NotNull @NotNull AxisAlignedBoundingBox collisionBbox, @NotNull @NotNull Vec3f rootTranslation, long checksum, @NotNull @NotNull Calendar sourceDate, @NotNull @NotNull String sourcePath, @NotNull @NotNull List<@NotNull ModelHierarchyNode> nodes)
      Creates an instance of a CachedModelHierarchy record class.
      Parameters:
      bbox - the value for the bbox record component
      collisionBbox - the value for the collisionBbox record component
      rootTranslation - the value for the rootTranslation record component
      checksum - the value for the checksum record component
      sourceDate - the value for the sourceDate record component
      sourcePath - the value for the sourcePath record component
      nodes - the value for the nodes record component
  • Method Details

    • nodeCount

      public long nodeCount()
      Specified by:
      nodeCount in interface ModelHierarchy
    • node

      @Nullable public @Nullable ModelHierarchyNode node(long i)
      Specified by:
      node in interface ModelHierarchy
    • cache

      @NotNull public @NotNull CachedModelHierarchy cache()
      Specified by:
      cache in interface CacheableObject<CachedModelHierarchy>
    • isCached

      public boolean isCached()
      Specified by:
      isCached in interface CacheableObject<CachedModelHierarchy>
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • bbox

      @NotNull public @NotNull AxisAlignedBoundingBox bbox()
      Returns the value of the bbox record component.
      Specified by:
      bbox in interface ModelHierarchy
      Returns:
      the value of the bbox record component
    • collisionBbox

      @NotNull public @NotNull AxisAlignedBoundingBox collisionBbox()
      Returns the value of the collisionBbox record component.
      Specified by:
      collisionBbox in interface ModelHierarchy
      Returns:
      the value of the collisionBbox record component
    • rootTranslation

      @NotNull public @NotNull Vec3f rootTranslation()
      Returns the value of the rootTranslation record component.
      Specified by:
      rootTranslation in interface ModelHierarchy
      Returns:
      the value of the rootTranslation record component
    • checksum

      public long checksum()
      Returns the value of the checksum record component.
      Specified by:
      checksum in interface ModelHierarchy
      Returns:
      the value of the checksum record component
    • sourceDate

      @NotNull public @NotNull Calendar sourceDate()
      Returns the value of the sourceDate record component.
      Specified by:
      sourceDate in interface ModelHierarchy
      Returns:
      the value of the sourceDate record component
    • sourcePath

      @NotNull public @NotNull String sourcePath()
      Returns the value of the sourcePath record component.
      Specified by:
      sourcePath in interface ModelHierarchy
      Returns:
      the value of the sourcePath record component
    • nodes

      @NotNull public @NotNull List<@NotNull ModelHierarchyNode> nodes()
      Returns the value of the nodes record component.
      Specified by:
      nodes in interface ModelHierarchy
      Returns:
      the value of the nodes record component