Enum Class AppEnvironment

java.lang.Object
java.lang.Enum<AppEnvironment>
com.emc.documentum.rest.config.AppEnvironment
All Implemented Interfaces:
Serializable, Comparable<AppEnvironment>, Constable

public enum AppEnvironment extends Enum<AppEnvironment>
The environment of current application. This implementation is a simplified customization to StandardEnvironment, where it creates a singleton instance of the standard environment.

See StandardEnvironment Javadoc for details on the variable overriding between property resources and the JVM system properties.

Since:
7.2.0
  • Enum Constant Details

    • INSTANCE

      public static final AppEnvironment INSTANCE
      The singleton instance of the environment.
  • Method Details

    • values

      public static AppEnvironment[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AppEnvironment valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public String get(String key)
      Return the property value associated with the given key, or null if the key cannot be resolved.
      Parameters:
      key - the property name to resolve
      Returns:
      the property value
      See Also:
    • get

      public <T> T get(String key, Class<T> targetType)
      Return the property value associated with the given key, or null if the key cannot be resolved.
      Type Parameters:
      T - the data type of the property value
      Parameters:
      key - the property name to resolve
      targetType - the expected class of the property value
      Returns:
      the property value
      See Also:
    • get

      public <T> T get(String key, Class<T> targetType, T defaultValue)
      Return the property value associated with the given key, or defaultValue if the key cannot be resolved.
      Type Parameters:
      T - the data type of the property value
      Parameters:
      key - the property name to resolve
      targetType - the expected type of the property value
      defaultValue - the default value to return if no value is found
      Returns:
      the property value
      See Also:
    • resetCache

      public void resetCache()
    • addFirstPropertySource

      public void addFirstPropertySource(String propertySourceClasspath)
      Add the given property source object with the highest precedence.
      Parameters:
      propertySourceClasspath - property source classpath
      See Also:
    • addLastPropertySource

      public void addLastPropertySource(String propertySourceClasspath)
      Add the given property source object with the lowest precedence.
      Parameters:
      propertySourceClasspath - property source classpath
      See Also:
    • removePropertySource

      public void removePropertySource(String propertySourceClasspath)
      Remove a property source from the application environment.
      Parameters:
      propertySourceClasspath - property source classpath
    • getPropertySources

      public org.springframework.core.env.PropertySources getPropertySources()
      Return the PropertySources for this AppEnvironment.

      See ConfigurableEnvironment.getPropertySources() Javadoc for details.

      Returns:
      property sources of this environment