Record Class PropertyKey<T,G>

java.lang.Object
java.lang.Record
com.j3d.gen.properties.PropertyKey<T,G>
Type Parameters:
T - The expected type of the property's value.
G - The type of the class that provides this property.
Record Components:
name - The unique name of the property.
description - A brief description of the property's purpose.
expectedClass - The Class object representing the expected type of the property's value.
providerClass - The Class object representing the class that provides this property.
constant - A boolean indicating whether this property's value is constant (true) or mutable (false).

public record PropertyKey<T,G>(String name, String description, Class<T> expectedClass, Class<G> providerClass, boolean constant) extends Record
Represents a key for a property, defining its name, description, expected type, the class that provides the property, and whether it's a constant.
  • Field Details

    • name

      private final String name
      The field for the name record component.
    • description

      private final String description
      The field for the description record component.
    • expectedClass

      private final Class<T> expectedClass
      The field for the expectedClass record component.
    • providerClass

      private final Class<G> providerClass
      The field for the providerClass record component.
    • constant

      private final boolean constant
      The field for the constant record component.
  • Constructor Details

    • PropertyKey

      public PropertyKey(String name, String description, Class<T> expectedClass, Class<G> providerClass, boolean constant)
      Creates an instance of a PropertyKey record class.
      Parameters:
      name - the value for the name record component
      description - the value for the description record component
      expectedClass - the value for the expectedClass record component
      providerClass - the value for the providerClass record component
      constant - the value for the constant record component
  • Method Details

    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The equality check for PropertyKey only considers name, expectedClass, and providerClass.
      Specified by:
      equals in class Record
      Parameters:
      o - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public 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
    • 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
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • expectedClass

      public Class<T> expectedClass()
      Returns the value of the expectedClass record component.
      Returns:
      the value of the expectedClass record component
    • providerClass

      public Class<G> providerClass()
      Returns the value of the providerClass record component.
      Returns:
      the value of the providerClass record component
    • constant

      public boolean constant()
      Returns the value of the constant record component.
      Returns:
      the value of the constant record component