Class NBConfiguration
java.lang.Object
io.nosqlbench.nb.api.config.standard.NBConfiguration
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNBConfiguration(NBConfigModel model, LinkedHashMap<String, Object> validConfig) Create a NBConfigReader from a known valid configuration and a config model. -
Method Summary
Modifier and TypeMethodDescriptionstatic NBConfigurationempty()<T> TGet a config value or object by name.<T> TgetEnvOptional(String name) Returns the value of the named parameter asgetOptional(String), so long as no env vars were reference OR all env var references were found.getMap()getModel()<T> Optional<T> getOptional(Class<T> type, String... names) getOptional(String name) getOptional(String... names) <T> TgetOrDefault(String name, T defaultValue) getWithEnv(String name) <T> TgetWithEnv(String name, Class<? extends T> vclass) booleanisEmpty()<T> TtoString()
-
Constructor Details
-
NBConfiguration
Create a NBConfigReader from a known valid configuration and a config model. This method is restricted to encourage construction of readers only by passing through the friendlyNBConfigModel.apply(Map)method.- Parameters:
model- A configuration model, describing what is allowed to be configured by name and type.validConfig- A valid config reader.
-
-
Method Details
-
getModel
-
empty
-
getEnvOptional
Returns the value of the named parameter asgetOptional(String), so long as no env vars were reference OR all env var references were found.- Parameters:
name- The name of the variable to look up- Returns:
- An optional value, if present and (optionally) interpolated correctly from the environment
-
getWithEnv
-
getWithEnv
-
get
Get a config value or object by name. This uses type inference (as a generic method) in addition to the internal model for type checking and ergonomic use. If you do not call this within an assignment or context where the Java compiler knows what type you are expecting, then useget(String, Class)instead.- Type Parameters:
T- The (inferred) generic type of the configuration value- Parameters:
name- The name of the configuration parameter- Returns:
- The value of type T, matching the config model type for the provided field name
-
get
-
getOptional
-
getOptional
-
getOptional
-
getOrDefault
-
param
-
toString
-
isEmpty
public boolean isEmpty() -
getMap
-