Interface EnvironmentParser

    • Method Detail

      • filter

        Stream<Pair<String,​String>> filter​(Pair<String,​String> entry)
                                          throws Exception
        Provides an opportunity to remove environment variables from parsing by the remainder of the pipeline. The pair can be modified if desired as well, such as to remove prefixes.
        Parameters:
        entry - an environment variable, encoded with the name on the left and the value on the right
        Returns:
        a stream containing the desired entries (if any) for this entry
        Throws:
        Exception - any
        See Also:
        Pair.mapLeft(Function)
      • tokenize

        List<String> tokenize​(String name)
                       throws Exception
        Splits the name of an environment variable into per-object segments. For example, if you want name SERVER__URL to mean an object "SERVER" and a field "URL", you would return a two element list ["SERVER", "URL"].
        Parameters:
        name - the name of the environment variable
        Returns:
        the per-object segments for the environment variable, starting with the segments closest to the root
        Throws:
        Exception - any
      • map

        String map​(String segment)
            throws Exception
        Transforms a segment. Most commonly, this is used to convert between case formats.
        Parameters:
        segment - a segment of the object path
        Returns:
        the transformed segment
        Throws:
        Exception - any
        See Also:
        CaseFormat