Package net.minecraft.core.component
Record Class DataComponentMap.Builder.SimpleMap
java.lang.Object
java.lang.Record
net.minecraft.core.component.DataComponentMap.Builder.SimpleMap
- All Implemented Interfaces:
Iterable<TypedDataComponent<?>>,DataComponentMap
- Enclosing class:
DataComponentMap.Builder
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 net.minecraft.core.component.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 net.minecraft.core.component.DataComponentMap
CODEC, EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleMap(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> Tget(DataComponentType<? extends T> p_335671_) booleanhas(DataComponentType<?> p_335479_) 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.component.DataComponentMap
filter, getOrDefault, getTyped, isEmpty, streamMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
map
The field for themaprecord component.
-
-
Constructor Details
-
SimpleMap
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 interfaceDataComponentMap
-
has
- 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
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). -
map
Returns the value of themaprecord component.- Returns:
- the value of the
maprecord component
-