public static class Configuration.Builder extends Object implements Configuration.ConfigBuilder<Configuration,Configuration.Builder>
| Modifier and Type | Field and Description |
|---|---|
private Properties |
props |
| Modifier | Constructor and Description |
|---|---|
protected |
Builder() |
protected |
Builder(Properties props) |
| Modifier and Type | Method and Description |
|---|---|
Configuration.Builder |
apply(Consumer<Configuration.Builder> function)
Apply the function to this builder.
|
Configuration |
build()
Build and return the immutable configuration.
|
Configuration.Builder |
changeString(Field field,
Function<String,String> function)
Apply the function to this builder to change a potentially existing string field.
|
Configuration.Builder |
changeString(String key,
Function<String,String> function)
Apply the function to this builder to change a potentially existing string field.
|
protected Configuration.Builder |
changeString(String key,
String defaultValue,
Function<String,String> function) |
Configuration.Builder |
with(String key,
String value)
Associate the given value with the specified key.
|
Configuration.Builder |
withDefault(String key,
String value)
If there is no field with the specified key, then associate the given value with the specified key.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchangeBoolean, changeBoolean, changeDouble, changeDouble, changeFloat, changeFloat, changeInteger, changeInteger, changeLong, changeLong, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefaultprivate final Properties props
protected Builder()
protected Builder(Properties props)
public Configuration.Builder with(String key, String value)
Configuration.ConfigBuilderwith in interface Configuration.ConfigBuilder<Configuration,Configuration.Builder>key - the keyvalue - the valuepublic Configuration.Builder withDefault(String key, String value)
Configuration.ConfigBuilderwithDefault in interface Configuration.ConfigBuilder<Configuration,Configuration.Builder>key - the keyvalue - the valuepublic Configuration.Builder apply(Consumer<Configuration.Builder> function)
Configuration.ConfigBuilderapply in interface Configuration.ConfigBuilder<Configuration,Configuration.Builder>function - the predefined field for the keypublic Configuration.Builder changeString(String key, Function<String,String> function)
Configuration.ConfigBuilderchangeString in interface Configuration.ConfigBuilder<Configuration,Configuration.Builder>key - the keyfunction - the function that computes the new value given a possibly-existing value; may not be nullpublic Configuration.Builder changeString(Field field, Function<String,String> function)
Configuration.ConfigBuilderchangeString in interface Configuration.ConfigBuilder<Configuration,Configuration.Builder>field - the predefined field for the keyfunction - the function that computes the new value given a possibly-existing value; may not be nullprotected Configuration.Builder changeString(String key, String defaultValue, Function<String,String> function)
public Configuration build()
Configuration.ConfigBuilderbuild in interface Configuration.ConfigBuilder<Configuration,Configuration.Builder>Copyright © 2021 JBoss by Red Hat. All rights reserved.