Record Class MeshTriangleName

java.lang.Object
java.lang.Record
io.github.toxicity188.javamesh.MeshTriangleName
Record Components:
single - model id for triangles that only need a single visible face
duplex - model id for triangles that must be visible from both sides

public record MeshTriangleName(@NotNull String single, @NotNull String duplex) extends Record
Holds the Minecraft model ids used for generated triangle elements.

 MeshTriangleName names = MeshTriangleName.of("item/mesh_triangle", "item/mesh_triangle_double");
 
Since:
0.0.1
  • Constructor Summary

    Constructors
    Constructor
    Description
    MeshTriangleName(@NotNull String single, @NotNull String duplex)
    Creates an instance of a MeshTriangleName record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Returns the value of the duplex record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static @NotNull MeshTriangleName
    of(@NotNull String single, @NotNull String duplex)
    Creates a record holding the model ids for single-sided and double-sided triangles.
    @NotNull String
    Returns the value of the single record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MeshTriangleName

      public MeshTriangleName(@NotNull @NotNull String single, @NotNull @NotNull String duplex)
      Creates an instance of a MeshTriangleName record class.
      Parameters:
      single - the value for the single record component
      duplex - the value for the duplex record component
  • Method Details

    • of

      @NotNull public static @NotNull MeshTriangleName of(@NotNull @NotNull String single, @NotNull @NotNull String duplex)
      Creates a record holding the model ids for single-sided and double-sided triangles.
      Parameters:
      single - model id for single-sided triangles
      duplex - model id for double-sided triangles
      Returns:
      a new triangle-name record
      Since:
      0.0.1
    • 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.
    • single

      @NotNull public @NotNull String single()
      Returns the value of the single record component.
      Returns:
      the value of the single record component
    • duplex

      @NotNull public @NotNull String duplex()
      Returns the value of the duplex record component.
      Returns:
      the value of the duplex record component