Record Class CopyNbtFunction.CopyOperation
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.functions.CopyNbtFunction.CopyOperation
- Enclosing class:
CopyNbtFunction
static record CopyNbtFunction.CopyOperation(CopyNbtFunction.Path sourcePath, CopyNbtFunction.Path targetPath, CopyNbtFunction.MergeStrategy op)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<CopyNbtFunction.CopyOperation>
private final CopyNbtFunction.MergeStrategy
The field for theop
record component.private final CopyNbtFunction.Path
The field for thesourcePath
record component.private final CopyNbtFunction.Path
The field for thetargetPath
record component. -
Constructor Summary
ConstructorDescriptionCopyOperation
(CopyNbtFunction.Path sourcePath, CopyNbtFunction.Path targetPath, CopyNbtFunction.MergeStrategy op) Creates an instance of aCopyOperation
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.op()
Returns the value of theop
record component.Returns the value of thesourcePath
record component.Returns the value of thetargetPath
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
sourcePath
The field for thesourcePath
record component. -
targetPath
The field for thetargetPath
record component. -
op
The field for theop
record component. -
CODEC
-
-
Constructor Details
-
CopyOperation
CopyOperation(CopyNbtFunction.Path sourcePath, CopyNbtFunction.Path targetPath, CopyNbtFunction.MergeStrategy op) Creates an instance of aCopyOperation
record class.- Parameters:
sourcePath
- the value for thesourcePath
record componenttargetPath
- the value for thetargetPath
record componentop
- the value for theop
record component
-
-
Method Details
-
apply
-
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)
. -
sourcePath
Returns the value of thesourcePath
record component.- Returns:
- the value of the
sourcePath
record component
-
targetPath
Returns the value of thetargetPath
record component.- Returns:
- the value of the
targetPath
record component
-
op
Returns the value of theop
record component.- Returns:
- the value of the
op
record component
-