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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<DataComponentPatch.PatchKey> private final boolean
The field for theremoved
record component.private final DataComponentType
<?> The field for thetype
record component. -
Constructor Summary
ConstructorDescriptionPatchKey
(DataComponentType<?> type, boolean removed) Creates an instance of aPatchKey
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
removed()
Returns the value of theremoved
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.com.mojang.serialization.Codec
<?>
-
Field Details
-
type
The field for thetype
record component. -
removed
private final boolean removedThe field for theremoved
record component. -
CODEC
-
-
Constructor Details
-
PatchKey
PatchKey(DataComponentType<?> type, boolean removed) Creates an instance of aPatchKey
record class.- Parameters:
type
- the value for thetype
record componentremoved
- the value for theremoved
record 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 thetype
record component.- Returns:
- the value of the
type
record component
-
removed
public boolean removed()Returns the value of theremoved
record component.- Returns:
- the value of the
removed
record component
-