Record Class DataMapFile<T,R>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.registries.datamaps.DataMapFile<T,R>
public record DataMapFile<T,R> (boolean replace, Map<com.mojang.datafixers.util.Either<TagKey<R>,ResourceKey<R>>,Optional<WithConditions<DataMapEntry<T>>>> values, List<DataMapEntry.Removal<T,R>> removals)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<DataMapEntry.Removal<T, R>> The field for theremovalsrecord component.private final booleanThe field for thereplacerecord component.private final Map<com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>>, Optional<WithConditions<DataMapEntry<T>>>> The field for thevaluesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDataMapFile(boolean replace, Map<com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>>, Optional<WithConditions<DataMapEntry<T>>>> values, List<DataMapEntry.Removal<T, R>> removals) Creates an instance of aDataMapFilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,R> com.mojang.serialization.Codec <DataMapFile<T, R>> codec(ResourceKey<Registry<R>> registryKey, DataMapType<R, T> dataMap) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.removals()Returns the value of theremovalsrecord component.booleanreplace()Returns the value of thereplacerecord component.final StringtoString()Returns a string representation of this record class.Map<com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>>, Optional<WithConditions<DataMapEntry<T>>>> values()Returns the value of thevaluesrecord component.
-
Field Details
-
replace
private final boolean replaceThe field for thereplacerecord component. -
values
private final Map<com.mojang.datafixers.util.Either<TagKey<R>,ResourceKey<R>>, valuesOptional<WithConditions<DataMapEntry<T>>>> The field for thevaluesrecord component. -
removals
The field for theremovalsrecord component.
-
-
Constructor Details
-
DataMapFile
public DataMapFile(boolean replace, Map<com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>>, Optional<WithConditions<DataMapEntry<T>>>> values, List<DataMapEntry.Removal<T, R>> removals) Creates an instance of aDataMapFilerecord class.- Parameters:
replace- the value for thereplacerecord componentvalues- the value for thevaluesrecord componentremovals- the value for theremovalsrecord component
-
-
Method Details
-
codec
public static <T,R> com.mojang.serialization.Codec<DataMapFile<T,R>> codec(ResourceKey<Registry<R>> registryKey, DataMapType<R, T> dataMap) -
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 '=='. -
replace
public boolean replace()Returns the value of thereplacerecord component.- Returns:
- the value of the
replacerecord component
-
values
public Map<com.mojang.datafixers.util.Either<TagKey<R>,ResourceKey<R>>, values()Optional<WithConditions<DataMapEntry<T>>>> Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
removals
Returns the value of theremovalsrecord component.- Returns:
- the value of the
removalsrecord component
-