Class EnvironmentProperties

  • All Implemented Interfaces:
    Properties, org.refcodes.mixin.DelimiterAccessor, org.refcodes.mixin.Dumpable, org.refcodes.mixin.TypeAccessor<java.lang.String>, org.refcodes.structure.CanonicalMap, org.refcodes.structure.Containable, org.refcodes.structure.Dictionary<java.lang.String,java.lang.String>, org.refcodes.structure.Keys<java.lang.String,java.lang.String>, org.refcodes.structure.PathMap<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin

    public class EnvironmentProperties
    extends java.lang.Object
    implements Properties
    Extension of the Properties type overwriting methods in order to access the operating system's environment variables as of env on Linux or Unix shells or set on Windows machines (e.g."set JAVA_HOME=/opt/java9"). The keys are transformed to an environment variable by removing a prefixed "/" path delimiter (as of Properties.getDelimiter() and converting all other path delimiters "/" to the environment variable's (de facto standard) separator "_". If accessing failed, then the upper case version of the so transformed key is probed. Accessing an environment variable "JAVA_HOME" would be done with the path "/java/home".
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.structure.CanonicalMap

        org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor

        org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
      • Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary

        org.refcodes.structure.Dictionary.MutableDictionary<K extends java.lang.Object,V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.Keys

        org.refcodes.structure.Keys.MutableKeys<K extends java.lang.Object,V extends java.lang.Object>, org.refcodes.structure.Keys.MutableValues<K extends java.lang.Object,V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap

        org.refcodes.structure.PathMap.MutablePathMap<T extends java.lang.Object>, org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<T extends java.lang.Object>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor

        org.refcodes.mixin.TypeAccessor.TypeMutator<T extends java.lang.Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Properties childrenOf​(java.lang.String aParentPath)
      boolean containsKey​(java.lang.Object aKey)
      The key is transformed to an environment variable by removing a prefixed "/" path delimiter (as of Properties.getDelimiter() and converting all other path delimiters "/" to the environment variable's (de facto standard) separator "_".
      java.lang.String get​(java.lang.Object aKey)
      The key is transformed to an environment variable by removing a prefixed "/" path delimiter (as of Properties.getDelimiter() and converting all other path delimiters "/" to the environment variable's (de facto standard) separator "_".
      boolean isEmpty()
      java.util.Set<java.lang.String> keySet()
      The keys are transformed to a path by prefixing a "/" path delimiter (as of Properties.getDelimiter() and converting all other environment variable's (de facto standard) separators "_" to the path delimiter "/".
      Properties retrieveFrom​(java.lang.String aFromPath)
      Properties retrieveTo​(java.lang.String aToPath)
      int size()
      java.lang.Object toDataStructure​(java.lang.String aFromPath)
      java.util.Collection<java.lang.String> values()
      • Methods inherited from interface org.refcodes.structure.CanonicalMap

        toInstance, toInstance, toType, toType
      • Methods inherited from interface org.refcodes.mixin.Dumpable

        toDump, toDump
      • Methods inherited from interface org.refcodes.structure.Keys

        use
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.structure.PathMap

        directories, directories, entries, entries, fromExternalKey, get, get, getArray, getArray, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getIndexes, getIndexes, getInteger, getInteger, getLong, getLong, getRootPath, getShort, getShort, hasIndexed, hasIndexed, hasParentPath, isArray, isArray, isDirectory, isEntry, isIndexed, isIndexed, isPath, isRecord, isRootPath, keySet, paths, paths, queryPaths, records, records, toDataStructure, toExternalKey, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath, toPath
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        containsKey, get, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
    • Constructor Detail

      • EnvironmentProperties

        public EnvironmentProperties()
    • Method Detail

      • get

        public java.lang.String get​(java.lang.Object aKey)
        The key is transformed to an environment variable by removing a prefixed "/" path delimiter (as of Properties.getDelimiter() and converting all other path delimiters "/" to the environment variable's (de facto standard) separator "_". If accessing failed, then the upper case version of the so transformed key is probed.
        Specified by:
        get in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
      • containsKey

        public boolean containsKey​(java.lang.Object aKey)
        The key is transformed to an environment variable by removing a prefixed "/" path delimiter (as of Properties.getDelimiter() and converting all other path delimiters "/" to the environment variable's (de facto standard) separator "_". If accessing failed, then the upper case version of the so transformed key is probed.
        Specified by:
        containsKey in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        The keys are transformed to a path by prefixing a "/" path delimiter (as of Properties.getDelimiter() and converting all other environment variable's (de facto standard) separators "_" to the path delimiter "/".
        Specified by:
        keySet in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
      • values

        public java.util.Collection<java.lang.String> values()
        Specified by:
        values in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
      • size

        public int size()
        Specified by:
        size in interface org.refcodes.structure.Containable
      • toDataStructure

        public java.lang.Object toDataStructure​(java.lang.String aFromPath)
        Specified by:
        toDataStructure in interface org.refcodes.structure.PathMap<java.lang.String>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface org.refcodes.structure.Containable
      • retrieveFrom

        public Properties retrieveFrom​(java.lang.String aFromPath)
        Specified by:
        retrieveFrom in interface org.refcodes.structure.CanonicalMap
        Specified by:
        retrieveFrom in interface org.refcodes.structure.PathMap<java.lang.String>
        Specified by:
        retrieveFrom in interface Properties
      • retrieveTo

        public Properties retrieveTo​(java.lang.String aToPath)
        Specified by:
        retrieveTo in interface org.refcodes.structure.CanonicalMap
        Specified by:
        retrieveTo in interface org.refcodes.structure.PathMap<java.lang.String>
        Specified by:
        retrieveTo in interface Properties
      • childrenOf

        public Properties childrenOf​(java.lang.String aParentPath)
        Specified by:
        childrenOf in interface org.refcodes.structure.CanonicalMap
        Specified by:
        childrenOf in interface org.refcodes.structure.PathMap<java.lang.String>
        Specified by:
        childrenOf in interface Properties