Package net.minecraft.core.component
Record Class DataComponentPatch.PatchKey
java.lang.Object
java.lang.Record
net.minecraft.core.component.DataComponentPatch.PatchKey
- Enclosing class:
DataComponentPatch
static record DataComponentPatch.PatchKey(DataComponentType<?> type, boolean removed)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DataComponentPatch.PatchKey> private final booleanThe field for theremovedrecord component.private final DataComponentType<?> The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPatchKey(DataComponentType<?> type, boolean removed) Creates an instance of aPatchKeyrecord 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.booleanremoved()Returns the value of theremovedrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.com.mojang.serialization.Codec<?>
-
Field Details
-
type
The field for thetyperecord component. -
removed
private final boolean removedThe field for theremovedrecord component. -
CODEC
-
-
Constructor Details
-
PatchKey
PatchKey(DataComponentType<?> type, boolean removed) Creates an instance of aPatchKeyrecord class.- Parameters:
type- the value for thetyperecord componentremoved- the value for theremovedrecord component
-
-
Method Details
-
valueCodec
public com.mojang.serialization.Codec<?> valueCodec() -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
removed
public boolean removed()Returns the value of theremovedrecord component.- Returns:
- the value of the
removedrecord component
-