Record Class PropertyRemap<T>
java.lang.Object
java.lang.Record
com.fastasyncworldedit.core.limit.PropertyRemap<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<B extends BlockStateHolder<B>>
Bapply
(B state) Apply remapping to a state.Apply remapping to a given value if the given block type has the property associated with this remap instance.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.newValue()
Returns the value of thenewValue
record component.oldValue()
Returns the value of theoldValue
record component.property()
Returns the value of theproperty
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PropertyRemap
New instance- Parameters:
property
- property to remap values foroldValue
- value to remap fromnewValue
- value to remap to
-
-
Method Details
-
apply
Apply remapping to a state. Will return original state if property is not present.- Parameters:
state
- Block to apply remapping to- Returns:
- new state
-
apply
Apply remapping to a given value if the given block type has the property associated with this remap instance.- Parameters:
type
- block type to checkvalue
- value to remap- Returns:
- new value
-
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 theproperty
record component.- Returns:
- the value of the
property
record component
-
oldValue
Returns the value of theoldValue
record component.- Returns:
- the value of the
oldValue
record component
-
newValue
Returns the value of thenewValue
record component.- Returns:
- the value of the
newValue
record component
-