Interface PropertyBuilder

All Superinterfaces:
org.refcodes.mixin.KeyAccessor<String>, org.refcodes.mixin.KeyAccessor.KeyBuilder<String,​PropertyBuilder>, org.refcodes.mixin.KeyAccessor.KeyMutator<String>, org.refcodes.mixin.KeyAccessor.KeyProperty<String>
All Known Implementing Classes:
PropertyBuilderImpl

public interface PropertyBuilder
extends org.refcodes.mixin.KeyAccessor.KeyProperty<String>, org.refcodes.mixin.KeyAccessor.KeyBuilder<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 Object,​B extends org.refcodes.mixin.KeyAccessor.KeyBuilder<K,​B>>, org.refcodes.mixin.KeyAccessor.KeyMutator<K extends Object>, org.refcodes.mixin.KeyAccessor.KeyProperty<K extends Object>
  • Method Summary

    Modifier and Type Method Description
    static String asNormalized​(String aText, char aSeparator)
    Normalizes the provided text.
    static PropertyBuilder build()
    This is a convenience method for easily instantiating the according builder.
    default String getEnvironmentVariable()
    Returns the according environment variable after having converted the key as of KeyAccessor.getKey() to an environment variable.
    String getEnvironmentVariable​(String aKey)
    Returns the according environment variable after having converted the provided key to an environment variable.
    default String getSystemProperty()
    Returns the according system's property after having converted the key as of KeyAccessor.getKey() to a system property.
    String getSystemProperty​(String aKey)
    Returns the according system's property after having converted the provided key to a system property.
    default String toEnvironmentVariable()
    Converts the key as of KeyAccessor.getKey() to an environment variable.
    String toEnvironmentVariable​(String aKey)
    Converts the provided key to an environment variable.
    default String toPath()
    Converts the key as of KeyAccessor.getKey() to a path (as of PathMap).
    String toPath​(String aKey)
    Converts the provided key as of KeyAccessor.getKey() to a path (as of PathMap).
    default String toSystemProperty()
    Converts the key as of KeyAccessor.getKey() to a system property.
    String toSystemProperty​(String aKey)
    Converts the provided key to a system property.

    Methods inherited from interface org.refcodes.mixin.KeyAccessor

    getKey

    Methods inherited from interface org.refcodes.mixin.KeyAccessor.KeyBuilder

    withKey

    Methods inherited from interface org.refcodes.mixin.KeyAccessor.KeyMutator

    setKey

    Methods inherited from interface org.refcodes.mixin.KeyAccessor.KeyProperty

    letKey
  • Method Details

    • toPath

      default String toPath()
      Converts the key as of KeyAccessor.getKey() to a path (as of PathMap). A path begins with a path delimiter "/" (as of Delimiter.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

      String toPath​(String aKey)
      Converts the provided key as of KeyAccessor.getKey() to a path (as of PathMap). A path begins with a path delimiter "/" (as of Delimiter.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 String toSystemProperty()
      Converts the key as of KeyAccessor.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 String toEnvironmentVariable()
      Converts the key as of KeyAccessor.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

      String toSystemProperty​(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

      String toEnvironmentVariable​(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 String getSystemProperty()
      Returns the according system's property after having converted the key as of KeyAccessor.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 String getEnvironmentVariable()
      Returns the according environment variable after having converted the key as of KeyAccessor.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

      String getSystemProperty​(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

      String getEnvironmentVariable​(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.
    • build

      static PropertyBuilder build()
      This is a convenience method for easily instantiating the according builder.
      Returns:
      an instance (using a default implementation) of this builder
    • asNormalized

      static String asNormalized​(String aText, char aSeparator)
      Normalizes the provided text.
      Parameters:
      aText - The text to be normalized.
      aSeparator - The character to be used for normalization.
      Returns:
      The normalized String (can be null).