Record Class DataComponentMap.Builder.SimpleMap
java.lang.Object
java.lang.Record
net.minecraft.core.component.DataComponentMap.Builder.SimpleMap
- All Implemented Interfaces:
Iterable<TypedDataComponent<?>>, DataComponentGetter, DataComponentMap
- Enclosing class:
DataComponentMap.Builder
private static record DataComponentMap.Builder.SimpleMap(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Object> map)
extends Record
implements DataComponentMap
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataComponentMap
DataComponentMap.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Object> The field for themaprecord component.Fields inherited from interface DataComponentMap
CODEC, EMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSimpleMap(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Object> map) Creates an instance of aSimpleMaprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.<T> @Nullable Tget(DataComponentType<? extends T> type) booleanhas(DataComponentType<?> type) final inthashCode()Returns a hash code value for this object.iterator()Set<DataComponentType<?>> keySet()it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Object> map()Returns the value of themaprecord component.intsize()toString()Returns a string representation of this record class.Methods inherited from interface DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, hasMethods inherited from interface DataComponentMap
filter, isEmpty, streamMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
map
The field for themaprecord component.
-
-
Constructor Details
-
SimpleMap
private SimpleMap(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Object> map) Creates an instance of aSimpleMaprecord class.- Parameters:
map- the value for themaprecord component
-
-
Method Details
-
get
- Specified by:
getin interfaceDataComponentGetter
-
has
- Specified by:
hasin interfaceDataComponentGetter- Specified by:
hasin interfaceDataComponentMap
-
keySet
- Specified by:
keySetin interfaceDataComponentMap
-
iterator
- Specified by:
iteratorin interfaceDataComponentMap- Specified by:
iteratorin interfaceIterable<TypedDataComponent<?>>
-
size
public int size()- Specified by:
sizein interfaceDataComponentMap
-
toString
-
hashCode
-
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). -
map
Returns the value of themaprecord component.- Returns:
- the value of the
maprecord component
-