Package org.refcodes.runtime
Interface PropertyBuilder
-
- All Superinterfaces:
org.refcodes.mixin.KeyAccessor<java.lang.String>
,org.refcodes.mixin.KeyAccessor.KeyBuilder<java.lang.String,PropertyBuilder>
,org.refcodes.mixin.KeyAccessor.KeyMutator<java.lang.String>
,org.refcodes.mixin.KeyAccessor.KeyProperty<java.lang.String>
- All Known Implementing Classes:
PropertyBuilderImpl
public interface PropertyBuilder extends org.refcodes.mixin.KeyAccessor.KeyProperty<java.lang.String>, org.refcodes.mixin.KeyAccessor.KeyBuilder<java.lang.String,PropertyBuilder>
Converts a key to the format of a system property (camel-case) or an environment variable (snake-case in upper-case).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.KeyAccessor
org.refcodes.mixin.KeyAccessor.KeyBuilder<K extends java.lang.Object,B extends org.refcodes.mixin.KeyAccessor.KeyBuilder<K,B>>, org.refcodes.mixin.KeyAccessor.KeyMutator<K extends java.lang.Object>, org.refcodes.mixin.KeyAccessor.KeyProperty<K extends java.lang.Object>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.String
getEnvironmentVariable()
Returns the according environment variable after having converted the key as ofKeyAccessor.getKey()
to an environment variable.java.lang.String
getEnvironmentVariable(java.lang.String aKey)
Returns the according environment variable after having converted the provided key to an environment variable.default java.lang.String
getSystemProperty()
Returns the according system's property after having converted the key as ofKeyAccessor.getKey()
to a system property.java.lang.String
getSystemProperty(java.lang.String aKey)
Returns the according system's property after having converted the provided key to a system property.default java.lang.String
toEnvironmentVariable()
Converts the key as ofKeyAccessor.getKey()
to an environment variable.java.lang.String
toEnvironmentVariable(java.lang.String aKey)
Converts the provided key to an environment variable.default java.lang.String
toPath()
Converts the key as ofKeyAccessor.getKey()
to a path (as ofPathMap
).java.lang.String
toPath(java.lang.String aKey)
Converts the provided key as ofKeyAccessor.getKey()
to a path (as ofPathMap
).default java.lang.String
toSystemProperty()
Converts the key as ofKeyAccessor.getKey()
to a system property.java.lang.String
toSystemProperty(java.lang.String aKey)
Converts the provided key to a system property.
-
-
-
Method Detail
-
toPath
default java.lang.String toPath()
Converts the key as ofKeyAccessor.getKey()
to a path (as ofPathMap
). A path begins with a path delimiter "/" (as ofDelimiter.PATH
and with all non alphanumeric digits being replaced by the path delimiter. Any non alphanumeric sequence is truncated to a single path delimiter.- Returns:
- The path representation of the according key.
-
toPath
java.lang.String toPath(java.lang.String aKey)
Converts the provided key as ofKeyAccessor.getKey()
to a path (as ofPathMap
). A path begins with a path delimiter "/" (as ofDelimiter.PATH
and with all non alphanumeric digits being replaced by the path delimiter. Any non alphanumeric sequence is truncated to a single path delimiter.- Parameters:
aKey
- The key to be converted.- Returns:
- The path representation of the according key.
-
toSystemProperty
default java.lang.String toSystemProperty()
Converts the key as ofKeyAccessor.getKey()
to a system property. A system property is the camel-case version of the according key.- Returns:
- The camel-case representation of the according key.
-
toEnvironmentVariable
default java.lang.String toEnvironmentVariable()
Converts the key as ofKeyAccessor.getKey()
to an environment variable. An environment variable is the upper-case snake-case version of the according key.- Returns:
- The upper-case snake-case representation of the according key.
-
toSystemProperty
java.lang.String toSystemProperty(java.lang.String aKey)
Converts the provided key to a system property. A system property is the camel-case version of the according key.- Parameters:
aKey
- The key to be converted.- Returns:
- The camel-case representation of the according key.
-
toEnvironmentVariable
java.lang.String toEnvironmentVariable(java.lang.String aKey)
Converts the provided key to an environment variable. An environment variable is the upper-case snake-case version of the according key.- Parameters:
aKey
- The key to be converted.- Returns:
- The upper-case snake-case representation of the according key.
-
getSystemProperty
default java.lang.String getSystemProperty()
Returns the according system's property after having converted the key as ofKeyAccessor.getKey()
to a system property. A system property is the camel-case version of the according key.- Returns:
- The system's property of the camel-case representation of the according key.
-
getEnvironmentVariable
default java.lang.String getEnvironmentVariable()
Returns the according environment variable after having converted the key as ofKeyAccessor.getKey()
to an environment variable. An environment variable is the upper-case snake-case version of the according key.- Returns:
- The environment variable of the upper-case snake-case representation of the according key.
-
getSystemProperty
java.lang.String getSystemProperty(java.lang.String aKey)
Returns the according system's property after having converted the provided key to a system property. A system property is the camel-case version of the according key.- Parameters:
aKey
- The value of the key to be converted.- Returns:
- The system's property of the camel-case representation of the according key.
-
getEnvironmentVariable
java.lang.String getEnvironmentVariable(java.lang.String aKey)
Returns the according environment variable after having converted the provided key to an environment variable. An environment variable is the upper-case snake-case version of the according key.- Parameters:
aKey
- The value of the key to be converted.- Returns:
- The environment variable of the upper-case snake-case representation of the according key.
-
-