Interface Context


public interface Context
Represents an individual context pair.

Context keys and values may not be null or empty. A key/value will be deemed empty if it's length is zero, or if it consists of only space characters.

See Also:
  • Method Details

    • isValidKey

      static boolean isValidKey(@Nullable String key)
      Tests whether key is valid.

      Context keys and values may not be null or empty. A key/value will be deemed empty if it's length is zero, or if it consists of only space characters.

      An exception is thrown when an invalid key is added to a ContextSet.

      Parameters:
      key - the key to test
      Returns:
      true if valid, false otherwise.
      Since:
      5.1
    • isValidValue

      static boolean isValidValue(@Nullable String value)
      Tests whether value is valid.

      Context keys and values may not be null or empty. A key/value will be deemed empty if it's length is zero, or if it consists of only space characters.

      An exception is thrown when an invalid value is added to a ContextSet.

      Parameters:
      value - the value to test
      Returns:
      true if valid, false otherwise.
      Since:
      5.1
    • getKey

      @NonNull String getKey()
      Gets the context key.
      Returns:
      the key
    • getValue

      @NonNull String getValue()
      Gets the context value
      Returns:
      the value