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

org.neo4j.helpers

## Class Args

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

-     public class Args
      extends Object

  Parses a String[] argument from a main-method. It expects values to be either key/value pairs or just "orphan" values (w/o a key associated).

  A key is defined with one or more dashes in the beginning, for example:

         '-path'
         '--path'

  A key/value pair can be either one single String from the array where there's a '=' delimiter between the key and value, like so:

         '--path=/my/path/to/something'

  ...or consist of two (consecutive) strings from the array, like so:

         '-path' '/my/path/to/something'

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Args(Map<String,String> source)`
    `Args(String... args)` Suitable for main( String[] args )

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String[]` | `asArgs()`
    `Map<String,String>` | `asMap()`
    `String` | `get(String key, String defaultValue)`
    `String` | `get(String key, String defaultValueIfNotFound, String defaultValueIfNoValue)`
    `Boolean` | `getBoolean(String key, Boolean defaultValue)`
    `Boolean` | `getBoolean(String key, Boolean defaultValueIfNotFound, Boolean defaultValueIfNoValue)`
    `<T extends Enum<T>> T` | `getEnum(Class<T> enumClass, String key, T defaultValue)`
    `Number` | `getNumber(String key, Number defaultValue)`
    `boolean` | `has(String key)`
    `static String` | `jarUsage(Class<?> main, String... params)`
    `List<String>` | `orphans()`
    `Object` | `put(String key, String value)`
    `void` | `putAll(Map<String,String> source)`
    `String[]` | `source()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### Args

          public Args(String... args)

      Suitable for main( String[] args )
      Parameters:
        `args` - the arguments to parse.

    - #### Args

          public Args(Map<String,String> source)

  - ### Method Detail

    - #### source

          public String[] source()

    - #### asMap

          public Map<String,String> asMap()

    - #### has

          public boolean has(String key)

    - #### get

          public String get(String key,
                   String defaultValue)

    - #### get

          public String get(String key,
                   String defaultValueIfNotFound,
                   String defaultValueIfNoValue)

    - #### getNumber

          public Number getNumber(String key,
                         Number defaultValue)

    - #### getBoolean

          public Boolean getBoolean(String key,
                           Boolean defaultValue)

    - #### getBoolean

          public Boolean getBoolean(String key,
                           Boolean defaultValueIfNotFound,
                           Boolean defaultValueIfNoValue)

    - #### getEnum

          public <T extends Enum<T>> T getEnum(Class<T> enumClass,
                                      String key,
                                      T defaultValue)

    - #### put

          public Object put(String key,
                   String value)

    - #### putAll

          public void putAll(Map<String,String> source)

    - #### orphans

          public List<String> orphans()

    - #### asArgs

          public String[] asArgs()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### jarUsage

          public static String jarUsage(Class<?> main,
                        String... params)

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