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
FieldsModifier and TypeFieldDescriptionprivate final com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> The field for thekeyrecord component.private final Optional<DataMapValueRemover<R, T>> The field for theremoverrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRemoval(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 aRemovalrecord 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 booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> key()Returns the value of thekeyrecord component.remover()Returns the value of theremoverrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
key
The field for thekeyrecord component. -
remover
The field for theremoverrecord 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 aRemovalrecord class.- Parameters:
key- the value for thekeyrecord componentremover- the value for theremoverrecord 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 thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
remover
Returns the value of theremoverrecord component.- Returns:
- the value of the
removerrecord component
-