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
Modifier and TypeFieldDescriptionprivate final List
<DataMapEntry.Removal<T, R>> The field for theremovals
record component.private final boolean
The field for thereplace
record component.private final Map
<com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>>, Optional<WithConditions<DataMapEntry<T>>>> The field for thevalues
record component. -
Constructor Summary
ConstructorDescriptionDataMapFile
(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 aDataMapFile
record 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 boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.removals()
Returns the value of theremovals
record component.boolean
replace()
Returns the value of thereplace
record component.final String
toString()
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 thevalues
record component.
-
Field Details
-
replace
private final boolean replaceThe field for thereplace
record component. -
values
private final Map<com.mojang.datafixers.util.Either<TagKey<R>,ResourceKey<R>>, valuesOptional<WithConditions<DataMapEntry<T>>>> The field for thevalues
record component. -
removals
The field for theremovals
record 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 aDataMapFile
record class.- Parameters:
replace
- the value for thereplace
record componentvalues
- the value for thevalues
record componentremovals
- the value for theremovals
record 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 thereplace
record component.- Returns:
- the value of the
replace
record component
-
values
public Map<com.mojang.datafixers.util.Either<TagKey<R>,ResourceKey<R>>, values()Optional<WithConditions<DataMapEntry<T>>>> Returns the value of thevalues
record component.- Returns:
- the value of the
values
record component
-
removals
Returns the value of theremovals
record component.- Returns:
- the value of the
removals
record component
-