Settings (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.helpers

## Class Settings

- java.lang.Object
- - org.neo4j.helpers.Settings

-     public final class Settings
      extends Object

  Create settings for configurations in Neo4j. See `GraphDatabaseSettings` for example. Each setting has a name, a parser that converts a string to the type of the setting, a default value, an optional inherited setting, and optional value converters. A parser is a function that takes a string and converts to some type T. The parser may throw IllegalArgumentException if it fails. The default value is the string representation of what you want as default. Special values are the constants NO_DEFAULT, which means that you don't want any default value at all, and MANDATORY, which means that the user has to specify a value for this setting. Not providing a mandatory value for a setting leads to an IllegalArgumentException. If a setting does not have a provided value, and no default, then

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Settings.DefaultSetting<T>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ANY`
    `static Function<String,Boolean>` | `BOOLEAN`
    `static Function<String,Long>` | `BYTES`
    `static Function<String,Double>` | `DOUBLE`
    `static Function<String,Long>` | `DURATION`
    `static String` | `DURATION_FORMAT`
    `static String` | `FALSE`
    `static Function<String,Float>` | `FLOAT`
    `static Function<String,HostnamePort>` | `HOSTNAME_PORT`
    `static Function<String,Integer>` | `INTEGER`
    `static Function2<File,Function<String,String>,File>` | `isDirectory`
    `static Function2<File,Function<String,String>,File>` | `isFile`
    `static Function<String,Long>` | `LONG`
    `static Function<String,Long>` | `LONG_WITH_OPTIONAL_UNIT` For values such as: 100M ==> 100 * 1024 * 1024 37261 ==> 37261 2g ==> 2 * 1024 * 1024 * 1024 50m ==> 50 * 1024 * 1024 10k ==> 10 * 1024
    `static String` | `MANDATORY`
    `static String` | `NO_DEFAULT`
    `static Function2<URI,Function<String,String>,URI>` | `normalize`
    `static Function<String,File>` | `PATH`
    `static Function2<Integer,Function<String,String>,Integer>` | `port`
    `static String` | `SIZE_FORMAT`
    `static Function<String,String>` | `STRING`
    `static Function2<String,Function<String,String>,String>` | `toLowerCase`
    `static String` | `TRUE`
    `static Function<String,URI>` | `URI`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Function2<File,Function<String,String>,File>` | `basePath(Setting<File> baseSetting)`
    `static <T> Function2<T,Function<String,String>,T>` | `illegalValueMessage(String message, Function2<T,Function<String,String>,T> valueFunction)`
    `static <T> Function<String,List<T>>` | `list(String separator, Function<String,T> itemParser)`
    `static Function2<String,Function<String,String>,String>` | `matches(String regex)`
    `static <T extends Comparable<T>> Function2<T,Function<String,String>,T>` | `max(T max)`
    `static <T extends Comparable<T>> Function2<T,Function<String,String>,T>` | `min(T min)`
    `static <T extends Enum> Function<String,T>` | `options(Class<T> enumClass)`
    `static <T> Function<String,T>` | `options(Iterable<T> optionValues)`
    `static <T> Function<String,T>` | `options(T... optionValues)`
    `static boolean` | `osIsMacOS()`
    `static boolean` | `osIsWindows()`
    `static <T extends Comparable<T>> Function2<T,Function<String,String>,T>` | `range(T min, T max)`
    `static <T> Setting<T>` | `setting(String name, Function<String,T> parser, Setting<T> inheritedSetting)`
    `static <T> Setting<T>` | `setting(String name, Function<String,T> parser, String defaultValue)`
    `static <T> Setting<T>` | `setting(String name, Function<String,T> parser, String defaultValue, Function2<T,Function<String,String>,T>... valueConverters)`
    `static <T> Setting<T>` | `setting(String name, Function<String,T> parser, String defaultValue, Setting<T> inheritedSetting, Function2<T,Function<String,String>,T>... valueConverters)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MANDATORY

          public static final String MANDATORY

    - #### NO_DEFAULT

          public static final String NO_DEFAULT

    - #### TRUE

          public static final String TRUE

      See Also:
        Constant Field Values

    - #### FALSE

          public static final String FALSE

      See Also:
        Constant Field Values

    - #### DURATION_FORMAT

          public static final String DURATION_FORMAT

      See Also:
        Constant Field Values

    - #### SIZE_FORMAT

          public static final String SIZE_FORMAT

      See Also:
        Constant Field Values

    - #### ANY

          public static final String ANY

      See Also:
        Constant Field Values

    - #### INTEGER

          public static final Function<String,Integer> INTEGER

    - #### LONG

          public static final Function<String,Long> LONG

    - #### BOOLEAN

          public static final Function<String,Boolean> BOOLEAN

    - #### FLOAT

          public static final Function<String,Float> FLOAT

    - #### DOUBLE

          public static final Function<String,Double> DOUBLE

    - #### STRING

          public static final Function<String,String> STRING

    - #### HOSTNAME_PORT

          public static final Function<String,HostnamePort> HOSTNAME_PORT

    - #### DURATION

          public static final Function<String,Long> DURATION

    - #### BYTES

          public static final Function<String,Long> BYTES

    - #### URI

          public static final Function<String,URI> URI

    - #### PATH

          public static final Function<String,File> PATH

    - #### LONG_WITH_OPTIONAL_UNIT

          public static final Function<String,Long> LONG_WITH_OPTIONAL_UNIT

      For values such as:
      - 100M
      ==> 100 * 1024 * 1024
      - 37261
      ==> 37261
      - 2g
      ==> 2 * 1024 * 1024 * 1024
      - 50m
      ==> 50 * 1024 * 1024
      - 10k
      ==> 10 * 1024

    - #### port

          public static final Function2<Integer,Function<String,String>,Integer> port

    - #### toLowerCase

          public static Function2<String,Function<String,String>,String> toLowerCase

    - #### normalize

          public static Function2<URI,Function<String,String>,URI> normalize

    - #### isFile

          public static Function2<File,Function<String,String>,File> isFile

    - #### isDirectory

          public static Function2<File,Function<String,String>,File> isDirectory

  - ### Method Detail

    - #### setting

          public static <T> Setting<T> setting(String name,
                               Function<String,T> parser,
                               String defaultValue)

    - #### setting

          public static <T> Setting<T> setting(String name,
                               Function<String,T> parser,
                               String defaultValue,
                               Function2<T,Function<String,String>,T>... valueConverters)

    - #### setting

          public static <T> Setting<T> setting(String name,
                               Function<String,T> parser,
                               Setting<T> inheritedSetting)

    - #### setting

          public static <T> Setting<T> setting(String name,
                               Function<String,T> parser,
                               String defaultValue,
                               Setting<T> inheritedSetting,
                               Function2<T,Function<String,String>,T>... valueConverters)

    - #### options

          public static <T extends Enum> Function<String,T> options(Class<T> enumClass)

    - #### options

          public static <T> Function<String,T> options(T... optionValues)

    - #### options

          public static <T> Function<String,T> options(Iterable<T> optionValues)

    - #### list

          public static <T> Function<String,List<T>> list(String separator,
                                          Function<String,T> itemParser)

    - #### matches

          public static Function2<String,Function<String,String>,String> matches(String regex)

    - #### min

          public static <T extends Comparable<T>> Function2<T,Function<String,String>,T> min(T min)

    - #### max

          public static <T extends Comparable<T>> Function2<T,Function<String,String>,T> max(T max)

    - #### range

          public static <T extends Comparable<T>> Function2<T,Function<String,String>,T> range(T min,
                                                                               T max)

    - #### illegalValueMessage

          public static <T> Function2<T,Function<String,String>,T> illegalValueMessage(String message,
                                                                       Function2<T,Function<String,String>,T> valueFunction)

    - #### basePath

          public static Function2<File,Function<String,String>,File> basePath(Setting<File> baseSetting)

    - #### osIsWindows

          public static boolean osIsWindows()

    - #### osIsMacOS

          public static boolean osIsMacOS()

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.