-
public final class CustomAttributesThis class provides store key-value pairs. These methods are thread-safe.
-
-
Method Summary
Modifier and Type Method Description booleanputString(String key, String value)Put a string value with the key.If the key already exists, the value will be overwritten. booleanputInt(String key, int value)Put an int value with the key.If the key already exists, the value will be overwritten. booleanputLong(String key, long value)Put a long value with the key.If the key already exists, the value will be overwritten. booleanputFloat(String key, float value)Put a float value with the key.If the key already exists, the value will be overwritten. booleanputDouble(String key, double value)Put a double value with the key.If the key already exists, the value will be overwritten. booleanputBoolean(String key, boolean value)Put a boolean value with the key.If the key already exists, the value will be overwritten. voidremove(String key)Remove the value with the key. voidremoveAll()Remove all key-value pairs. -
-
Method Detail
-
putString
boolean putString(String key, String value)
Put a string value with the key.If the key already exists, the value will be overwritten.
- Parameters:
key- key must be non-null and match the valid pattern.value- value must be non-null and its length must be less than 64.
-
putInt
boolean putInt(String key, int value)
Put an int value with the key.If the key already exists, the value will be overwritten.
- Parameters:
key- key must be non-null and match the valid pattern.value- int value
-
putLong
boolean putLong(String key, long value)
Put a long value with the key.If the key already exists, the value will be overwritten.
- Parameters:
key- key must be non-null and match the valid pattern.value- long value
-
putFloat
boolean putFloat(String key, float value)
Put a float value with the key.If the key already exists, the value will be overwritten.
- Parameters:
key- key must be non-null and match the valid pattern.value- float value
-
putDouble
boolean putDouble(String key, double value)
Put a double value with the key.If the key already exists, the value will be overwritten.
- Parameters:
key- key must be non-null and match the valid pattern.value- double value
-
putBoolean
boolean putBoolean(String key, boolean value)
Put a boolean value with the key.If the key already exists, the value will be overwritten.
- Parameters:
key- key must be non-null and match the valid pattern.value- boolean value
-
remove
void remove(String key)
Remove the value with the key.
- Parameters:
key- name of the key to be removed.
-
removeAll
void removeAll()
Remove all key-value pairs.
-
-
-
-