Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.neo4j.helpers.collection
Class MapUtil

    java.lang.Object
      org.neo4j.helpers.collection.MapUtil

    public abstract class MapUtil

extends Object

Utility to create `Map`s.

Constructor Summary
`MapUtil()`

Method Summary
`static
`<K,V> Map<K,V>`
` | `genericMap(Map<K,V> targetMap, Object... objects)` A short-hand method for adding key/value pairs into a `Map`.
`static
`<K,V> Map<K,V>`
` | `genericMap(Object... objects)` A short-hand method for creating a `Map` of key/value pairs.
`static Map<String,String>` | `load(File file)` Loads a `Map` from a `File` assuming strings as keys and values.
`static Map<String,String>` | `load(InputStream stream)` Loads a `Map` from an `InputStream` assuming strings as keys and values.
`static Map<String,String>` | `load(Reader reader)` Loads a `Map` from a `Reader` assuming strings as keys and values.
`static Map<String,String>` | `loadStrictly(File file)` Loads a `Map` from a `File` assuming strings as keys and values.
`static Map<String,String>` | `loadStrictly(InputStream stream)` Loads a `Map` from an `InputStream` assuming strings as keys and values.
`static Map<String,String>` | `loadStrictly(Reader reader)` Loads a `Map` from a `Reader` assuming strings as keys and values.
`static Map<String,Object>` | `map(Map<String,Object> targetMap, Object... objects)` A short-hand method for creating a `Map` of key/value pairs where keys are `String`s and values are `Object`s.
`static Map<String,Object>` | `map(Object... objects)` A short-hand method for creating a `Map` of key/value pairs where keys are `String`s and values are `Object`s.
`static Map<String,String>` | `stringMap(Map<String,String> targetMap, String... strings)` A short-hand method for creating a `Map` of key/value pairs where both keys and values are `String`s.
`static Map<String,String>` | `stringMap(String... strings)` A short-hand method for creating a `Map` of key/value pairs where both keys and values are `String`s.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MapUtil

    public MapUtil()

Method Detail

### genericMap

    public static <K,V> Map<K,V> genericMap(Object... objects)

  A short-hand method for creating a `Map` of key/value pairs.

  Type Parameters:
    `K` - type of keys
    `V` - type of values
  Parameters:
    `objects` - alternating key and value.
  Returns:
    a Map with the entries supplied by `objects`.

### genericMap

    public static <K,V> Map<K,V> genericMap(Map<K,V> targetMap,
                                            Object... objects)

  A short-hand method for adding key/value pairs into a `Map`.

  Type Parameters:
    `K` - type of keys
    `V` - type of values
  Parameters:
    `targetMap` - the `Map` to put the objects into.
    `objects` - alternating key and value.
  Returns:
    a Map with the entries supplied by `objects`.

### stringMap

    public static Map<String,String> stringMap(String... strings)

  A short-hand method for creating a `Map` of key/value pairs where both keys and values are `String`s.

  Parameters:
    `strings` - alternating key and value.
  Returns:
    a Map with the entries supplied by `strings`.

### stringMap

    public static Map<String,String> stringMap(Map<String,String> targetMap,
                                               String... strings)

  A short-hand method for creating a `Map` of key/value pairs where both keys and values are `String`s.

  Parameters:
    `targetMap` - the `Map` to put the objects into.
    `strings` - alternating key and value.
  Returns:
    a Map with the entries supplied by `strings`.

### map

    public static Map<String,Object> map(Object... objects)

  A short-hand method for creating a `Map` of key/value pairs where keys are `String`s and values are `Object`s.

  Parameters:
    `objects` - alternating key and value.
  Returns:
    a Map with the entries supplied by `objects`.

### map

    public static Map<String,Object> map(Map<String,Object> targetMap,
                                         Object... objects)

  A short-hand method for creating a `Map` of key/value pairs where keys are `String`s and values are `Object`s.

  Parameters:
    `targetMap` - the `Map` to put the objects into.
    `objects` - alternating key and value.
  Returns:
    a Map with the entries supplied by `objects`.

### load

    public static Map<String,String> load(Reader reader)
                                   throws IOException

  Loads a `Map` from a `Reader` assuming strings as keys and values.

  Parameters:
    `reader` - the `Reader` containing a `Properties`-like layout of keys and values.
  Returns:
    the read data as a `Map`.
  Throws:
    `IOException` - if the `reader` throws `IOException`.

### loadStrictly

    public static Map<String,String> loadStrictly(Reader reader)

  Loads a `Map` from a `Reader` assuming strings as keys and values. Any `IOException` is wrapped and thrown as a `RuntimeException` instead.

  Parameters:
    `reader` - the `Reader` containing a `Properties`-like layout of keys and values.
  Returns:
    the read data as a `Map`.

### load

    public static Map<String,String> load(InputStream stream)
                                   throws IOException

  Loads a `Map` from an `InputStream` assuming strings as keys and values.

  Parameters:
    `stream` - the `InputStream` containing a `Properties`-like layout of keys and values.
  Returns:
    the read data as a `Map`.
  Throws:
    `IOException` - if the `stream` throws `IOException`.

### loadStrictly

    public static Map<String,String> loadStrictly(InputStream stream)

  Loads a `Map` from an `InputStream` assuming strings as keys and values. Any `IOException` is wrapped and thrown as a `RuntimeException` instead.

  Parameters:
    `stream` - the `InputStream` containing a `Properties`-like layout of keys and values.
  Returns:
    the read data as a `Map`.

### load

    public static Map<String,String> load(File file)
                                   throws IOException

  Loads a `Map` from a `File` assuming strings as keys and values.

  Parameters:
    `file` - the `File` containing a `Properties`-like layout of keys and values.
  Returns:
    the read data as a `Map`.
  Throws:
    `IOException` - if the file reader throws `IOException`.

### loadStrictly

    public static Map<String,String> loadStrictly(File file)

  Loads a `Map` from a `File` assuming strings as keys and values. Any `IOException` is wrapped and thrown as a `RuntimeException` instead.

  Parameters:
    `file` - the `File` containing a `Properties`-like layout of keys and values.
  Returns:
    the read data as a `Map`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011 The Neo4j Graph Database Project. All Rights Reserved.