Record Class PropertyValuePair<T>
java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.core.structures.properties.PropertyValuePair<T>
- Type Parameters:
T- The type of the property.- Record Components:
property- The property.value- The value of the property.
Represents a property-value pair.
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyValuePair(Property<T> property, IPropertyValue<T> value) Creates an instance of aPropertyValuePairrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T> PropertyValuePair<?> of(Property<T> property, IPropertyValue<?> value) Creates a new property-value pair.property()Returns the value of thepropertyrecord component.Shortcut forvalue().IPropertyValue.value().final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
of
Creates a new property-value pair.- Parameters:
property- The property.value- The value of the property.- Returns:
- A new property-value pair.
- Throws:
IllegalArgumentException- If the value is not of the correct type for the property.
-
propertyValue
Shortcut forvalue().IPropertyValue.value().- Returns:
- The value of the property.
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
property
Returns the value of thepropertyrecord component.- Returns:
- the value of the
propertyrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-