Package 

Class CustomAttributes


  • 
    public final class CustomAttributes
    
                        

    This class provides store key-value pairs. These methods are thread-safe.

    • Method Summary

      Modifier and Type Method Description
      boolean putString(String key, String value) Put a string value with the key.If the key already exists, the value will be overwritten.
      boolean putInt(String key, int value) Put an int value with the key.If the key already exists, the value will be overwritten.
      boolean putLong(String key, long value) Put a long value with the key.If the key already exists, the value will be overwritten.
      boolean putFloat(String key, float value) Put a float value with the key.If the key already exists, the value will be overwritten.
      boolean putDouble(String key, double value) Put a double value with the key.If the key already exists, the value will be overwritten.
      boolean putBoolean(String key, boolean value) Put a boolean value with the key.If the key already exists, the value will be overwritten.
      void remove(String key) Remove the value with the key.
      void removeAll() Remove all key-value pairs.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.