Package com.complexible.common.base
Class PropertiesBuilder
java.lang.Object
com.complexible.common.base.PropertiesBuilder
Simple builder class for creating instances of Properties
- Since:
- 0.3
- Version:
- 2.2.1
- Author:
- Michael Grove
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuild()Return the created Properties instancestatic PropertiesBuildercreate()Create a new PropertiesBuilderstatic Propertiesstatic PropertiesBuilderCreate a new PropertiesBuilderstatic PropertiesBuildercreate(Properties theProps) Create a new PropertiesBuilderGet the specified property from this builder.static PropertiespropertiesFromFile(Path theSource) static PropertiespropertiesFromString(String theContents) static StringpropertiesToString(Properties properties) static StringpropertiesToString(Properties properties, boolean includeTimestamp) Remove the specified propertySet the specified property key-value pairtoString()withPrefix(String thePrefix)
-
Method Details
-
create
Create a new PropertiesBuilder- Returns:
- a new builder
-
create
Create a new PropertiesBuilder- Parameters:
theProps- create a new builder starting from the provided set of properties. A copy of these properties are made, the original remains unaltered by the builder.- Returns:
- a new builder
-
create
Create a new PropertiesBuilder- Parameters:
theSource- create a new builder starting from the provided properties file.- Returns:
- a new builder
-
create
-
get
Get the specified property from this builder.- Parameters:
theKey- the key- Returns:
- the value or null if not set
-
set
Set the specified property key-value pair- Parameters:
theKey- the keytheValue- the value- Returns:
- this builder
-
remove
Remove the specified property- Parameters:
theKey- the key- Returns:
- this builder
-
setTrue
-
setFalse
-
withPrefix
-
toString
-
build
Return the created Properties instance- Returns:
- the properties
-
propertiesToString
-
propertiesToString
-
propertiesFromString
-
propertiesFromFile
-