Package 

Class KuzzleMap

  • All Implemented Interfaces:
    java.io.Serializable , kotlin.Cloneable , kotlin.collections.Map , kotlin.collections.MutableMap

    
    public final class KuzzleMap
    extends HashMap<String, Any>
                        

    KuzzleMap is a Class that extends Map to be ThreadSafe and that has the purpose of giving a wrapper on top of Map to easily manipulate them.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class KuzzleMap.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      KuzzleMap() Create a new instance of CustomMap
      KuzzleMap(Map<String, Object> map) Create a new instance of CustomMap from a Map<String></String>, Object>.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final KuzzleMap put(String s, Object o)
      Object get(String key)
      final Boolean isNull(String key) Check whether the key value is null or not.
      final Boolean isString(String key) Check whether the key value is a String or not.
      final Boolean isBoolean(String key) Check whether the key value is a Boolean or not.
      final Boolean isNumber(String key) Check whether the key value is a Number or not.
      final Boolean isArrayList(String key) Check whether the key value is an ArrayList or not.
      final Boolean isMap(String key) Check whether the key value is a Map or not.
      final String getString(String key) Return the specified key value or null if the value is not a String.
      final Boolean getBoolean(String key) Return the specified key value or null if the value is not a Boolean.
      final Number getNumber(String key) Return the specified key value or null if the value is not a Number.
      final ArrayList<?> getArrayList(String key) Return the specified key value or null if the value is not an ArrayList.
      final KuzzleMap getMap(String key) Return the specified key value or null if the value is not a Map.
      final String optString(String key, String def) Return the specified key value or the def value if the value is nul or not a String.
      final Boolean optBoolean(String key, Boolean def) Return the specified key value or the def value if the value is nul or not a Boolean.
      final Number optNumber(String key, Number def) Return the specified key value or the def value if the value is nul or not a Number.
      final ArrayList<?> optArrayList(String key, ArrayList<?> def) Return the specified key value or the def value if the value is nul or not an ArrayList.
      final KuzzleMap optMap(String key, Map<String, Object> def) Return the specified key value or the def value if the value is nul or not a Map.
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getEntries, getKeys, getOrDefault, getSize, getValues, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KuzzleMap

        KuzzleMap()
        Create a new instance of CustomMap
      • KuzzleMap

        KuzzleMap(Map<String, Object> map)
        Create a new instance of CustomMap from a Map<String></String>, Object>.
        Parameters:
        map - Map<String></String>, Object> representing JSON.
    • Method Detail

      • isNull

         final Boolean isNull(String key)

        Check whether the key value is null or not.

        Parameters:
        key - a String representing the key.
      • isString

         final Boolean isString(String key)

        Check whether the key value is a String or not.

        Parameters:
        key - a String representing the key.
      • isBoolean

         final Boolean isBoolean(String key)

        Check whether the key value is a Boolean or not.

        Parameters:
        key - a String representing the key.
      • isNumber

         final Boolean isNumber(String key)

        Check whether the key value is a Number or not.

        Parameters:
        key - a String representing the key.
      • isArrayList

         final Boolean isArrayList(String key)

        Check whether the key value is an ArrayList or not.

        Parameters:
        key - a String representing the key.
      • isMap

         final Boolean isMap(String key)

        Check whether the key value is a Map or not.

        Parameters:
        key - a String representing the key.
      • getString

         final String getString(String key)

        Return the specified key value or null if the value is not a String.

        Parameters:
        key - a String representing the key.
      • getBoolean

         final Boolean getBoolean(String key)

        Return the specified key value or null if the value is not a Boolean.

        Parameters:
        key - a String representing the key.
      • getNumber

         final Number getNumber(String key)

        Return the specified key value or null if the value is not a Number.

        Parameters:
        key - a String representing the key.
      • getArrayList

         final ArrayList<?> getArrayList(String key)

        Return the specified key value or null if the value is not an ArrayList.

        Parameters:
        key - a String representing the key.
      • getMap

         final KuzzleMap getMap(String key)

        Return the specified key value or null if the value is not a Map.

        Parameters:
        key - a String representing the key.
      • optString

         final String optString(String key, String def)

        Return the specified key value or the def value if the value is nul or not a String.

        Parameters:
        key - a String representing the key.
      • optBoolean

         final Boolean optBoolean(String key, Boolean def)

        Return the specified key value or the def value if the value is nul or not a Boolean.

        Parameters:
        key - a String representing the key.
      • optNumber

         final Number optNumber(String key, Number def)

        Return the specified key value or the def value if the value is nul or not a Number.

        Parameters:
        key - a String representing the key.
      • optArrayList

         final ArrayList<?> optArrayList(String key, ArrayList<?> def)

        Return the specified key value or the def value if the value is nul or not an ArrayList.

        Parameters:
        key - a String representing the key.
      • optMap

         final KuzzleMap optMap(String key, Map<String, Object> def)

        Return the specified key value or the def value if the value is nul or not a Map.

        Parameters:
        key - a String representing the key.