Record Class DataMapEntry.Removal<T,R>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.registries.datamaps.DataMapEntry.Removal<T,R>
- Enclosing class:
DataMapEntry<T>
public static record DataMapEntry.Removal<T,R> (com.mojang.datafixers.util.Either<TagKey<R>,ResourceKey<R>> key, Optional<DataMapValueRemover<R,T>> remover)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final com.mojang.datafixers.util.Either<TagKey<R>,
ResourceKey<R>> The field for thekey
record component.private final Optional<DataMapValueRemover<R,
T>> The field for theremover
record component. -
Constructor Summary
ModifierConstructorDescriptionprivate
Removal
(com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> key) Removal
(com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> key, Optional<DataMapValueRemover<R, T>> remover) Creates an instance of aRemoval
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
R> com.mojang.serialization.Codec<DataMapEntry.Removal<T, R>> codec
(com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>>> tagOrValue, DataMapType<R, T> attachment) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.com.mojang.datafixers.util.Either<TagKey<R>,
ResourceKey<R>> key()
Returns the value of thekey
record component.remover()
Returns the value of theremover
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
key
The field for thekey
record component. -
remover
The field for theremover
record component.
-
-
Constructor Details
-
Removal
-
Removal
public Removal(com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> key, Optional<DataMapValueRemover<R, T>> remover) Creates an instance of aRemoval
record class.- Parameters:
key
- the value for thekey
record componentremover
- the value for theremover
record component
-
-
Method Details
-
codec
public static <T,R> com.mojang.serialization.Codec<DataMapEntry.Removal<T,R>> codec(com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>>> tagOrValue, DataMapType<R, T> attachment) -
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)
. -
key
Returns the value of thekey
record component.- Returns:
- the value of the
key
record component
-
remover
Returns the value of theremover
record component.- Returns:
- the value of the
remover
record component
-