Class ConfigurationKey.Parameter

java.lang.Object
io.inverno.mod.configuration.ConfigurationKey.Parameter
Direct Known Subclasses:
ConfigurationKey.UndefinedParameter, ConfigurationKey.WildcardParameter
Enclosing interface:
ConfigurationKey

public static class ConfigurationKey.Parameter extends Object

A parameter is used to specify the context in which a property value is defined.

Since:
1.0
Author:
Jeremy Kuhn
  • Field Details

    • key

      protected final String key
      The parameter key.
    • value

      protected final Object value
      The paramteter value.
  • Method Details

    • getKey

      public String getKey()

      Returns the parameter name.

      Returns:
      the name of the parameter
    • getValue

      public Object getValue()

      Returns the parameter value.

      Returns:
      the value of the parameter
    • isWildcard

      public boolean isWildcard()

      Determines whether the parameter is a wildcard parameter.

      Returns:
      true if the parameter is a wildcard parameter, false otherwise
    • isUndefined

      public boolean isUndefined()

      Determines whether the parameter is an undefined parameter.

      Returns:
      true if the parameter is an undefined parameter, false otherwise
    • of

      public static ConfigurationKey.Parameter of(String key, Object value) throws IllegalArgumentException

      Creates a parameter with the specified key and value.

      Parameters:
      key - the parameter key
      value - the parameter value
      Returns:
      a parameter
      Throws:
      IllegalArgumentException - if the key is null or empty or if the value is null or not a string, nor a primitive
    • wildcard

      public static ConfigurationKey.Parameter wildcard(String key) throws IllegalArgumentException

      Creates a wildcard parameter with the specified key.

      Parameters:
      key - the parameter key
      Returns:
      a wildcard parameter
      Throws:
      IllegalArgumentException - if the key is null or empty
    • undefined

      public static ConfigurationKey.Parameter undefined(String key) throws IllegalArgumentException

      Creates an undefined parameter with the specified key.

      Parameters:
      key - the parameter key
      Returns:
      an undefined parameter
      Throws:
      IllegalArgumentException - if the key is null or empty
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object