public enum ConfigLoader extends Enum<ConfigLoader>
${property} within strings with System properties or supplied properties.
Files must be in YAML format that conform to WireType.TEXT. For example:
!SimpleConfig {
name: "some name",
value: 10,
}
The class must be fully qualified or added to the ClassAliasPool to
enable the conversion.
ClassAliasPool.CLASS_ALIASES.addAlias(SimpleConfig.class);
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
load(String fileAsString) |
static String |
loadFile(Class<?> classLoader,
String filename) |
static <T> T |
loadFromFile(Class<?> classLoader,
String filename) |
static <T> T |
loadFromFile(Class<?> classLoader,
String filename,
Properties properties) |
static <T> T |
loadFromFile(String filename) |
static <T> T |
loadFromFile(String filename,
Properties properties) |
static <T> T |
loadWithProperties(String fileAsString,
Properties properties) |
static ConfigLoader |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConfigLoader[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static ConfigLoader[] values()
for (ConfigLoader c : ConfigLoader.values()) System.out.println(c);
public static ConfigLoader valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static String loadFile(Class<?> classLoader, String filename) throws IOException
IOExceptionpublic static <T> T loadFromFile(String filename) throws IOException
IOExceptionpublic static <T> T loadFromFile(Class<?> classLoader, String filename) throws IOException
IOExceptionpublic static <T> T loadFromFile(String filename, Properties properties) throws IOException
IOExceptionpublic static <T> T loadFromFile(Class<?> classLoader, String filename, Properties properties) throws IOException
IOExceptionpublic static <T> T load(String fileAsString)
public static <T> T loadWithProperties(String fileAsString, Properties properties)
Copyright © 2024. All rights reserved.