Class DataComponent.MapPatch

java.lang.Object
com.saicone.rtag.data.DataComponent.MapPatch
Enclosing class:
DataComponent

@Experimental public static class DataComponent.MapPatch extends Object
Class to invoke methods from PatchedDataComponentMap.
A patched map is a subclass of DataComponentMap but mutable, that means all the methods from component map are applicable in a patched map.
  • Method Details

    • getValue

      public static it.unimi.dsi.fastutil.objects.Reference2ObjectMap<Object,Object> getValue(Object map)
      Get the map value from patched map.
      Parameters:
      map - the patched map to get the value itself.
      Returns:
      a Reference2ObjectMap inside patched map.
    • set

      public static Object set(Object map, Object type, Object value)
      Set provided object type by a DataComponentType declaration of object itself into patched map.
      Parameters:
      map - the patched map to put value into.
      type - the DataComponentType instance.
      value - the object value declared by component type.
      Returns:
      the value that was set before in patched map, null otherwise.
    • setValue

      public static void setValue(Object map, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<Object,Object> value)
      Replace the map value into patched map.
      Parameters:
      map - the patched map to set the map value.
      value - a Reference2ObjectMap with DataComponentType as keys and declared objects has values.
    • remove

      public static Object remove(Object map, Object type)
      Remove the provided DataComponentType mapping from patched map.
      Parameters:
      map - the patched map to remove component type.
      type - the DataComponentType instance to remove.
      Returns:
      the value that was set before in patched map, null otherwise.