Package com.j3d.gen.properties
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- TheClassobject representing the expected type of the property's value.providerClass- TheClassobject 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 Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theconstantrecord component.private final StringThe field for thedescriptionrecord component.The field for theexpectedClassrecord component.private final StringThe field for thenamerecord component.The field for theproviderClassrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanconstant()Returns the value of theconstantrecord component.Returns the value of thedescriptionrecord component.booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpectedClassrecord component.inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of theproviderClassrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
name
The field for thenamerecord component. -
description
The field for thedescriptionrecord component. -
expectedClass
The field for theexpectedClassrecord component. -
providerClass
The field for theproviderClassrecord component. -
constant
private final boolean constantThe field for theconstantrecord component.
-
-
Constructor Details
-
PropertyKey
public PropertyKey(String name, String description, Class<T> expectedClass, Class<G> providerClass, boolean constant) Creates an instance of aPropertyKeyrecord class.- Parameters:
name- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentexpectedClass- the value for theexpectedClassrecord componentproviderClass- the value for theproviderClassrecord componentconstant- the value for theconstantrecord component
-
-
Method Details
-
equals
Indicates whether some other object is "equal to" this one. The equality check for PropertyKey only considersname,expectedClass, andproviderClass. -
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. -
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. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
expectedClass
Returns the value of theexpectedClassrecord component.- Returns:
- the value of the
expectedClassrecord component
-
providerClass
Returns the value of theproviderClassrecord component.- Returns:
- the value of the
providerClassrecord component
-
constant
public boolean constant()Returns the value of theconstantrecord component.- Returns:
- the value of the
constantrecord component
-