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
Modifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.Reference2ObjectMap
<DataComponentType<?>, Object> The field for themap
record component.Fields inherited from interface net.minecraft.core.component.DataComponentMap
CODEC, EMPTY
-
Constructor Summary
ConstructorDescriptionSimpleMap
(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Object> map) Creates an instance of aSimpleMap
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.<T> T
get
(DataComponentType<? extends T> p_335671_) boolean
has
(DataComponentType<?> p_335479_) final int
hashCode()
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 themap
record component.int
size()
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.component.DataComponentMap
filter, getOrDefault, getTyped, isEmpty, stream
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
map
The field for themap
record component.
-
-
Constructor Details
-
SimpleMap
SimpleMap(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Object> map) Creates an instance of aSimpleMap
record class.- Parameters:
map
- the value for themap
record component
-
-
Method Details
-
get
- Specified by:
get
in interfaceDataComponentMap
-
has
- Specified by:
has
in interfaceDataComponentMap
-
keySet
- Specified by:
keySet
in interfaceDataComponentMap
-
iterator
- Specified by:
iterator
in interfaceDataComponentMap
- Specified by:
iterator
in interfaceIterable<TypedDataComponent<?>>
-
size
public int size()- Specified by:
size
in 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 themap
record component.- Returns:
- the value of the
map
record component
-