Enum ConsulConfigProperties.Format
- java.lang.Object
-
- java.lang.Enum<ConsulConfigProperties.Format>
-
- org.springframework.cloud.consul.config.ConsulConfigProperties.Format
-
- All Implemented Interfaces:
Serializable,Comparable<ConsulConfigProperties.Format>
- Enclosing class:
- ConsulConfigProperties
public static enum ConsulConfigProperties.Format extends Enum<ConsulConfigProperties.Format>
There are many ways in which we can specify configuration in consul i.e.,- Nested key value style: Where value is either a constant or part of the key (nested). For e.g., For following configuration a.b.c=something a.b.d=something else One can specify the configuration in consul with key as "../kv/config/application/a/b/c" and value as "something" and key as "../kv/config/application/a/b/d" and value as "something else"
- Entire contents of properties file as value For e.g., For following configuration a.b.c=something a.b.d=something else One can specify the configuration in consul with key as "../kv/config/application/properties" and value as whole configuration " a.b.c=something a.b.d=something else "
- as Json or YML. You get it.
- Author:
- srikalyan.swayampakula
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FILESIndicates that the configuration specified in consul uses keys as files.KEY_VALUEIndicates that the configuration specified in consul is of type native key values.PROPERTIESIndicates that the configuration specified in consul is of property style i.e., value of the consul key would be a list of key=value pairs separated by new lines.YAMLIndicates that the configuration specified in consul is of YAML style i.e., value of the consul key would be YAML format.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConsulConfigProperties.FormatvalueOf(String name)Returns the enum constant of this type with the specified name.static ConsulConfigProperties.Format[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
KEY_VALUE
public static final ConsulConfigProperties.Format KEY_VALUE
Indicates that the configuration specified in consul is of type native key values.
-
PROPERTIES
public static final ConsulConfigProperties.Format PROPERTIES
Indicates that the configuration specified in consul is of property style i.e., value of the consul key would be a list of key=value pairs separated by new lines.
-
YAML
public static final ConsulConfigProperties.Format YAML
Indicates that the configuration specified in consul is of YAML style i.e., value of the consul key would be YAML format.
-
FILES
public static final ConsulConfigProperties.Format FILES
Indicates that the configuration specified in consul uses keys as files. This is useful for tools like git2consul.
-
-
Method Detail
-
values
public static ConsulConfigProperties.Format[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConsulConfigProperties.Format c : ConsulConfigProperties.Format.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConsulConfigProperties.Format valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
-