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
  • Field Details

    • map

      private final it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>,Object> map
      The field for the map record component.
  • Constructor Details

    • SimpleMap

      SimpleMap(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>,Object> map)
      Creates an instance of a SimpleMap record class.
      Parameters:
      map - the value for the map record component
  • Method Details

    • get

      @Nullable public <T> T get(DataComponentType<? extends T> p_331063_)
      Specified by:
      get in interface DataComponentMap
    • has

      public boolean has(DataComponentType<?> p_331343_)
      Specified by:
      has in interface DataComponentMap
    • keySet

      public Set<DataComponentType<?>> keySet()
      Specified by:
      keySet in interface DataComponentMap
    • iterator

      public Iterator<TypedDataComponent<?>> iterator()
      Specified by:
      iterator in interface DataComponentMap
      Specified by:
      iterator in interface Iterable<TypedDataComponent<?>>
    • size

      public int size()
      Specified by:
      size in interface DataComponentMap
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • map

      public it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>,Object> map()
      Returns the value of the map record component.
      Returns:
      the value of the map record component