Class MapUtil
java.lang.Object
com.github.unafraid.telegrambot.util.MapUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(String name) Return the boolean associated to the key put in parameter ("name")booleangetBoolean(String name, boolean defaultValue) Return the boolean associated to the key put in parameter ("name").byteReturns the byte associated to the key put in parameter ("name").byteReturns the int associated to the key put in parameter ("name").doubleReturns the double associated to the key put in parameter ("name").doubleReturns the double associated to the key put in parameter ("name").<T extends Enum<T>>
TReturns an enumeration of <T> from the set<T extends Enum<T>>
TReturns an enumeration of <T> from the set.getEnumList(String key, Class<T> clazz) getEnumSet(String key, Class<T> clazz) floatReturns the float associated to the key put in parameter ("name").floatReturns the float associated to the key put in parameter ("name").float[]getFloatArray(String name, String delimiter) intReturns the int associated to the key put in parameter ("name").int[]getIntArray(String name, String delimiter) Returns the int[] associated to the key put in parameter ("name").intgetInteger(String name, int defaultValue) Returns the int associated to the key put in parameter ("name").Returns the set of values<T> List<T><T> List<T>longReturns the long associated to the key put in parameter ("name").longReturns the long associated to the key put in parameter ("name").<K,V> Map<K, V> getMapOfList(String key, Class<K> keyClass, Class<V> valueClass) final <A> A<T> Set<T><T> Set<T>shortReturns the short associated to the key put in parameter ("name").shortReturns the short associated to the key put in parameter ("name").Returns the String associated to the key put in parameter ("name").Returns the String associated to the key put in parameter ("name").voidAdd a set of couple values in the current setPuts key-value pair inside the internal map, replacing previously existing key
-
Constructor Details
-
MapUtil
public MapUtil() -
MapUtil
-
-
Method Details
-
getInternalMap
Returns the set of values- Returns:
- HashMap
-
merge
Add a set of couple values in the current set- Parameters:
newSet- : MapSet pointing out the list of couples to add in the current set
-
put
Puts key-value pair inside the internal map, replacing previously existing key- Parameters:
name- String designating the key in the setvalue- value associated to the key- Returns:
- the same instance of current MapSet so it can be chained like: mapSet.put("key", "value").put("another key", "another value");
-
getBoolean
Return the boolean associated to the key put in parameter ("name")- Parameters:
name- : String designating the key in the set- Returns:
- boolean : value associated to the key
-
getBoolean
Return the boolean associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : boolean designating the default value if value associated with the key is null- Returns:
- boolean : value of the key
-
getByte
Returns the int associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : byte designating the default value if value associated with the key is null- Returns:
- byte : value associated to the key
-
getByte
Returns the byte associated to the key put in parameter ("name").- Parameters:
name- : String designating the key in the set- Returns:
- byte : value associated to the key
-
getShort
Returns the short associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : short designating the default value if value associated with the key is null- Returns:
- short : value associated to the key
-
getShort
Returns the short associated to the key put in parameter ("name").- Parameters:
name- : String designating the key in the set- Returns:
- short : value associated to the key
-
getInt
Returns the int associated to the key put in parameter ("name").- Parameters:
name- : String designating the key in the set- Returns:
- int : value associated to the key
-
getInteger
Returns the int associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : int designating the default value if value associated with the key is null- Returns:
- int : value associated to the key
-
getIntArray
Returns the int[] associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdelimiter- the delimiter- Returns:
- int[] : value associated to the key
-
getFloatArray
-
getLong
Returns the long associated to the key put in parameter ("name").- Parameters:
name- : String designating the key in the set- Returns:
- long : value associated to the key
-
getLong
Returns the long associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : long designating the default value if value associated with the key is null- Returns:
- long : value associated to the key
-
getFloat
Returns the float associated to the key put in parameter ("name").- Parameters:
name- : String designating the key in the set- Returns:
- float : value associated to the key
-
getFloat
Returns the float associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : float designating the default value if value associated with the key is null- Returns:
- float : value associated to the key
-
getDouble
Returns the double associated to the key put in parameter ("name").- Parameters:
name- : String designating the key in the set- Returns:
- double : value associated to the key
-
getDouble
Returns the double associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : float designating the default value if value associated with the key is null- Returns:
- double : value associated to the key
-
getString
Returns the String associated to the key put in parameter ("name").- Parameters:
name- : String designating the key in the set- Returns:
- String : value associated to the key
-
getString
Returns the String associated to the key put in parameter ("name"). If the value associated to the key is null, this method returns the value of the parameter defaultValue.- Parameters:
name- : String designating the key in the setdefaultValue- : String designating the default value if value associated with the key is null- Returns:
- String : value associated to the key
-
getEnum
Returns an enumeration of <T> from the set- Type Parameters:
T- : Class of the enumeration returned- Parameters:
name- : String designating the key in the setenumClass- : Class designating the class of the value associated with the key in the set- Returns:
- enum of type T
-
getEnum
Returns an enumeration of <T> from the set. If the enumeration is empty, the method returns the value of the parameter "defaultValue".- Type Parameters:
T- : Class of the enumeration returned- Parameters:
name- : String designating the key in the setenumClass- : Class designating the class of the value associated with the key in the setdefaultValue- : T designating the value by default- Returns:
- enum of type T
-
getObject
-
getList
-
getList
-
getSet
-
getSet
-
getEnumList
-
getEnumSet
-
getMap
-
getMapOfList
-