Class PropertyBuilderImpl

  • All Implemented Interfaces:
    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>, PropertyBuilder

    public class PropertyBuilderImpl
    extends java.lang.Object
    implements PropertyBuilder
    The Class PropertyBuilderImpl.
    • 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>
    • Constructor Detail

      • PropertyBuilderImpl

        public PropertyBuilderImpl()
    • Method Detail

      • getKey

        public java.lang.String getKey()
        Specified by:
        getKey in interface org.refcodes.mixin.KeyAccessor<java.lang.String>
      • setKey

        public void setKey​(java.lang.String aKey)
        Specified by:
        setKey in interface org.refcodes.mixin.KeyAccessor.KeyMutator<java.lang.String>
      • withKey

        public PropertyBuilder withKey​(java.lang.String aKey)
        Specified by:
        withKey in interface org.refcodes.mixin.KeyAccessor.KeyBuilder<java.lang.String,PropertyBuilder>
      • toPath

        public java.lang.String toPath​(java.lang.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.
        Specified by:
        toPath in interface PropertyBuilder
        Parameters:
        aKey - The key to be converted.
        Returns:
        The path representation of the according key.
      • toSystemProperty

        public 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.
        Specified by:
        toSystemProperty in interface PropertyBuilder
        Parameters:
        aKey - The key to be converted.
        Returns:
        The camel-case representation of the according key.
      • toEnvironmentVariable

        public 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.
        Specified by:
        toEnvironmentVariable in interface PropertyBuilder
        Parameters:
        aKey - The key to be converted.
        Returns:
        The upper-case snake-case representation of the according key.
      • getSystemProperty

        public 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.
        Specified by:
        getSystemProperty in interface PropertyBuilder
        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

        public 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.
        Specified by:
        getEnvironmentVariable in interface PropertyBuilder
        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.
      • toNormalized

        protected static java.lang.String toNormalized​(java.lang.String aText,
                                                       char aSeparator)