Class ObjectMap<K>

java.lang.Object
net.ME1312.Galaxi.Library.Map.ObjectMap<K>
Type Parameters:
K - Key Type
Direct Known Subclasses:
YAMLSection

public class ObjectMap<K> extends Object
Object Map Class
  • Constructor Details

    • ObjectMap

      public ObjectMap()
      Creates an empty Object Map
    • ObjectMap

      public ObjectMap(Map<? extends K,?> map)
      Creates an Object Map from Map Contents
      Parameters:
      map - Map
    • ObjectMap

      public ObjectMap(ObjectMap<? extends K> map)
      Creates an Object Map from Map Contents
      Parameters:
      map - Map
  • Method Details

    • get

      public Map<K,?> get()
      Get a copy of the original Object Map
      Returns:
      Object Map
    • clone

      public ObjectMap<K> clone()
      Clone this Map
      Returns:
      Map Clone
    • getParent

      public ObjectMap<K> getParent()
      Go up a level in the config (or null if this is the top layer)
      Returns:
      Super Map
    • key

      public <T> ObjectMap<T> key()
      Change the Key type of this map
      Type Parameters:
      T - Key Type
      Returns:
      Object Map
    • getKeys

      public Set<K> getKeys()
      Get the Keys
      Returns:
      KeySet
    • getValues

      public Collection<? extends ObjectMapValue<K>> getValues()
      Get the Values
      Returns:
      Values
    • getEntries

      public Collection<Map.Entry<K,ObjectMapValue<K>>> getEntries()
      Get the Entries
      Returns:
      Entries
    • contains

      public boolean contains(K handle)
      Check if a Handle exists
      Parameters:
      handle - Handle
      Returns:
      if that handle exists
    • set

      public void set(K handle, Object value)
      Set an Object into this Map
      Parameters:
      handle - Handle
      value - Value
    • safeSet

      public void safeSet(K handle, Object value)
      Set an Object into this Map without overwriting the existing value
      Parameters:
      handle - Handle
      value - Value
    • safeSet

      public void safeSet(K handle, Supplier<?> value)
      Set an Object into this Map without overwriting the existing value
      Parameters:
      handle - Handle
      value - Value
    • setAll

      public void setAll(Map<? extends K,?> values)
      Set all Objects into this Map
      Parameters:
      values - Map to set
    • safeSetAll

      public void safeSetAll(Map<? extends K,?> values)
      Set all Objects into this Map without overwriting existing values
      Parameters:
      values - Map to set
    • setAll

      public void setAll(ObjectMap<? extends K> values)
      Copy all Objects to this Map
      Parameters:
      values - Object Map to merge
    • safeSetAll

      public void safeSetAll(ObjectMap<? extends K> values)
      Copy all Objects to this Map without overwriting existing values
      Parameters:
      values - Object Map to merge
    • remove

      public void remove(K handle)
      Remove an Object by Handle
      Parameters:
      handle - Handle
    • clear

      public void clear()
      Remove all Objects from this Map
    • get

      public ObjectMapValue<K> get(K handle)
      Get an Object by Handle
      Parameters:
      handle - Handle
      Returns:
      Object
    • get

      public ObjectMapValue<K> get(K handle, Object def)
      Get an Object by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object
    • get

      public ObjectMapValue<K> get(K handle, Supplier<?> def)
      Get an Object by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object
    • get

      public ObjectMapValue<K> get(K handle, ObjectMapValue<K> def)
      Get an Object by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object
    • getList

      public List<? extends ObjectMapValue<K>> getList(K handle)
      Get a List by Handle
      Parameters:
      handle - Handle
      Returns:
      Object
    • getList

      public List<? extends ObjectMapValue<K>> getList(K handle, Collection<?> def)
      Get a List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object List
    • getList

      public List<? extends ObjectMapValue<K>> getList(K handle, Supplier<? extends Collection<?>> def)
      Get a List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object List
    • getList

      public List<? extends ObjectMapValue<K>> getList(K handle, List<? extends ObjectMapValue<K>> def)
      Get a List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object List
    • getObject

      public Object getObject(K handle)
      Get an Object by Handle
      Parameters:
      handle - Handle
      Returns:
      Object
    • getObject

      public Object getObject(K handle, Object def)
      Get an Object by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object
    • getObject

      public Object getObject(K handle, Supplier<?> def)
      Get an Object by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object
    • getObjectList

      public List<?> getObjectList(K handle)
      Get an Object List by Handle
      Parameters:
      handle - Handle
      Returns:
      Object List
    • getObjectList

      public List<?> getObjectList(K handle, List<?> def)
      Get an Object List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object List
    • getObjectList

      public List<?> getObjectList(K handle, Supplier<? extends List<?>> def)
      Get an Object List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object List
    • getBoolean

      public Boolean getBoolean(K handle)
      Get a Boolean by Handle
      Parameters:
      handle - Handle
      Returns:
      Boolean
    • getBoolean

      public Boolean getBoolean(K handle, Boolean def)
      Get a Boolean by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Boolean
    • getBoolean

      public Boolean getBoolean(K handle, Supplier<Boolean> def)
      Get a Boolean by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Boolean
    • getBooleanList

      public List<Boolean> getBooleanList(K handle)
      Get a Boolean List by Handle
      Parameters:
      handle - Handle
      Returns:
      Boolean List
    • getBooleanList

      public List<Boolean> getBooleanList(K handle, List<Boolean> def)
      Get a Boolean List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Boolean List
    • getBooleanList

      public List<Boolean> getBooleanList(K handle, Supplier<? extends List<Boolean>> def)
      Get a Boolean List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Boolean List
    • getMap

      public ObjectMap<K> getMap(K handle)
      Get an Object Map by Handle
      Parameters:
      handle - Handle
      Returns:
      Object Map
    • getMap

      public ObjectMap<K> getMap(K handle, Map<? extends K,?> def)
      Get an Object Map by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object Map
    • getMap

      public ObjectMap<K> getMap(K handle, ObjectMap<? extends K> def)
      Get an Object Map by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object Map
    • getMap

      public ObjectMap<K> getMap(K handle, Supplier<? extends ObjectMap<? extends K>> def)
      Get an Object Map by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object Map
    • getMapList

      public List<? extends ObjectMap<K>> getMapList(K handle)
      Get an Object Map List by Handle
      Parameters:
      handle - Handle
      Returns:
      Object Map List
    • getMapList

      public List<? extends ObjectMap<K>> getMapList(K handle, Collection<? extends Map<? extends K,?>> def)
      Get an Object Map List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object Map List
    • getMapList

      public List<? extends ObjectMap<K>> getMapList(K handle, List<? extends ObjectMap<? extends K>> def)
      Get an Object Map List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object Map List
    • getMapList

      public List<? extends ObjectMap<K>> getMapList(K handle, Supplier<? extends List<? extends ObjectMap<? extends K>>> def)
      Get an Object Map List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Object Map List
    • getDouble

      public Double getDouble(K handle)
      Get a Double by Handle
      Parameters:
      handle - Handle
      Returns:
      Double
    • getDouble

      public Double getDouble(K handle, Double def)
      Get a Double by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Double
    • getDouble

      public Double getDouble(K handle, Supplier<Double> def)
      Get a Double by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Double
    • getDoubleList

      public List<Double> getDoubleList(K handle)
      Get a Double List by Handle
      Parameters:
      handle - Handle
      Returns:
      Double List
    • getDoubleList

      public List<Double> getDoubleList(K handle, List<Double> def)
      Get a Double List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Double List
    • getDoubleList

      public List<Double> getDoubleList(K handle, Supplier<? extends List<Double>> def)
      Get a Double List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Double List
    • getFloat

      public Float getFloat(K handle)
      Get a Float by Handle
      Parameters:
      handle - Handle
      Returns:
      Float
    • getFloat

      public Float getFloat(K handle, Float def)
      Get a Float by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Float
    • getFloat

      public Float getFloat(K handle, Supplier<Float> def)
      Get a Float by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Float
    • getFloatList

      public List<Float> getFloatList(K handle)
      Get a Float List by Handle
      Parameters:
      handle - Handle
      Returns:
      Float List
    • getFloatList

      public List<Float> getFloatList(K handle, List<Float> def)
      Get a Float List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Float List
    • getFloatList

      public List<Float> getFloatList(K handle, Supplier<? extends List<Float>> def)
      Get a Float List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Float List
    • getInt

      public Integer getInt(K handle)
      Get an Integer by Handle
      Parameters:
      handle - Handle
      Returns:
      Integer
    • getInt

      public Integer getInt(K handle, Integer def)
      Get an Integer by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Integer
    • getInt

      public Integer getInt(K handle, Supplier<Integer> def)
      Get an Integer by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Integer
    • getIntList

      public List<Integer> getIntList(K handle)
      Get an Integer List by Handle
      Parameters:
      handle - Handle
      Returns:
      Integer List
    • getIntList

      public List<Integer> getIntList(K handle, List<Integer> def)
      Get an Integer List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Integer List
    • getIntList

      public List<Integer> getIntList(K handle, Supplier<? extends List<Integer>> def)
      Get an Integer List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Integer List
    • getLong

      public Long getLong(K handle)
      Get a Long by Handle
      Parameters:
      handle - Handle
      Returns:
      Long
    • getLong

      public Long getLong(K handle, Long def)
      Get a Long by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Long
    • getLong

      public Long getLong(K handle, Supplier<Long> def)
      Get a Long by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Long
    • getLongList

      public List<Long> getLongList(K handle)
      Get a Long List by Handle
      Parameters:
      handle - Handle
      Returns:
      Long List
    • getLongList

      public List<Long> getLongList(K handle, List<Long> def)
      Get a Long List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Long List
    • getLongList

      public List<Long> getLongList(K handle, Supplier<? extends List<Long>> def)
      Get a Long List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Long List
    • getShort

      public Short getShort(K handle)
      Get a Short by Handle
      Parameters:
      handle - Handle
      Returns:
      Short
    • getShort

      public Short getShort(K handle, Short def)
      Get a Short by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Short
    • getShort

      public Short getShort(K handle, Supplier<Short> def)
      Get a Short by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Short
    • getShortList

      public List<Short> getShortList(K handle)
      Get a Short List by Handle
      Parameters:
      handle - Handle
      Returns:
      Short List
    • getShortList

      public List<Short> getShortList(K handle, List<Short> def)
      Get a Short List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Short List
    • getShortList

      public List<Short> getShortList(K handle, Supplier<? extends List<Short>> def)
      Get a Short List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Short List
    • getString

      public String getString(K handle)
      Get a String by Handle
      Parameters:
      handle - Handle
      Returns:
      String
    • getString

      public String getString(K handle, String def)
      Get a String by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      String
    • getString

      public String getString(K handle, Supplier<String> def)
      Get a String by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      String
    • getStringList

      public List<String> getStringList(K handle)
      Get a String List by Handle
      Parameters:
      handle - Handle
      Returns:
      String List
    • getStringList

      public List<String> getStringList(K handle, List<String> def)
      Get a String List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      String List
    • getStringList

      public List<String> getStringList(K handle, Supplier<? extends List<String>> def)
      Get a String List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      String List
    • getUUID

      public UUID getUUID(K handle)
      Get a UUID by Handle
      Parameters:
      handle - Handle
      Returns:
      UUID
    • getUUID

      public UUID getUUID(K handle, UUID def)
      Get a UUID by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      UUID
    • getUUID

      public UUID getUUID(K handle, Supplier<UUID> def)
      Get a UUID by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      UUID
    • getUUIDList

      public List<UUID> getUUIDList(K handle)
      Get a UUID List by Handle
      Parameters:
      handle - Handle
      Returns:
      UUID List
    • getUUIDList

      public List<UUID> getUUIDList(K handle, List<UUID> def)
      Get a UUID List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      UUID List
    • getUUIDList

      public List<UUID> getUUIDList(K handle, Supplier<? extends List<UUID>> def)
      Get a UUID List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      UUID List
    • getVersion

      public Version getVersion(K handle)
      Get a Version by Handle
      Parameters:
      handle - Handle
      Returns:
      Version
    • getVersion

      public Version getVersion(K handle, Version def)
      Get a Version by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Version
    • getVersion

      public Version getVersion(K handle, Supplier<Version> def)
      Get a Version by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Version
    • getVersionList

      public List<Version> getVersionList(K handle)
      Get a Version List by Handle
      Parameters:
      handle - Handle
      Returns:
      Version List
    • getVersionList

      public List<Version> getVersionList(K handle, List<Version> def)
      Get a Version List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Version List
    • getVersionList

      public List<Version> getVersionList(K handle, Supplier<? extends List<Version>> def)
      Get a Version List by Handle
      Parameters:
      handle - Handle
      def - Default
      Returns:
      Version List
    • isNull

      public boolean isNull(K handle)
      Check if object is Null by Handle
      Parameters:
      handle - Handle
      Returns:
      Object Null Status
    • isBoolean

      public boolean isBoolean(K handle)
      Check if object is a Boolean by Handle
      Parameters:
      handle - Handle
      Returns:
      Object Boolean Status
    • isMap

      public boolean isMap(K handle)
      Check if object is an Object Map by Handle
      Parameters:
      handle - Handle
      Returns:
      Object Map Status
    • isList

      public boolean isList(K handle)
      Check if object is a List by Handle
      Parameters:
      handle - Handle
      Returns:
      Object List Status
    • isNumber

      public boolean isNumber(K handle)
      Check if object is a Number by Handle
      Parameters:
      handle - Handle
      Returns:
      Number Status
    • isString

      public boolean isString(K handle)
      Check if object is a String by Handle
      Parameters:
      handle - Handle
      Returns:
      Object String Status
    • isUUID

      public boolean isUUID(K handle)
      Check if object is a UUID by Handle
      Parameters:
      handle - Handle
      Returns:
      Object UUID Status
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object