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.apache.james.mime4j.util
Class StringArrayMap

    java.lang.Object
      org.apache.james.mime4j.util.StringArrayMap

All Implemented Interfaces:
  java.io.Serializable

    public class StringArrayMap

extends java.lang.Object
implements java.io.Serializable

An object, which may be used to implement header, or parameter maps. The maps keys are the header or parameter names. The maps values are strings (single value), lists, or arrays.

See Also:
  Serialized Form

Constructor Summary
`StringArrayMap()`

Method Summary
`protected void` | `addMapValue(java.util.Map pMap, java.lang.String pName, java.lang.String pValue)` Adds a value to the given map.
`void` | `addValue(java.lang.String pName, java.lang.String pValue)` Adds a new name/value pair.
`static java.util.Map` | `asMap(java.util.Map pMap)` Converts the given map into a string array map: The map values are string arrays.
`static java.lang.String` | `asString(java.lang.Object pValue)` Converts the given object into a string.
`static java.lang.String[]` | `asStringArray(java.lang.Object pValue)` Converts the given object into a string array.
`static java.util.Enumeration` | `asStringEnum(java.lang.Object pValue)` Converts the given object into a string enumeration.
`protected java.lang.String` | `convertName(java.lang.String pName)` Lower cases the given name.
`java.util.Map` | `getMap()` Returns an unmodifiable map of name/value pairs.
`java.lang.String[]` | `getNameArray()` Returns the set of registered names.
`java.util.Enumeration` | `getNames()` Returns the set of registered names as an enumeration.
`java.lang.String` | `getValue(java.lang.String pName)` Returns the requested value.
`java.util.Enumeration` | `getValueEnum(java.lang.String pName)` Returns the requested values as an enumeration.
`java.lang.String[]` | `getValues(java.lang.String pName)` Returns the requested values as a string array.

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

Constructor Detail

### StringArrayMap

    public StringArrayMap()

Method Detail

### asString

    public static java.lang.String asString(java.lang.Object pValue)

  Converts the given object into a string. The object may be either of:

  - a string, which is returned without conversion
  - a list of strings, in which case the first element is returned
  - an array of strings, in which case the first element is returned

### asStringArray

    public static java.lang.String[] asStringArray(java.lang.Object pValue)

  Converts the given object into a string array. The object may be either of:

  - a string, which is returned as an array with one element
  - a list of strings, which is being converted into a string array
  - an array of strings, which is returned without conversion

### asStringEnum

    public static java.util.Enumeration asStringEnum(java.lang.Object pValue)

  Converts the given object into a string enumeration. The object may be either of:

  - a string, which is returned as an enumeration with one element
  - a list of strings, which is being converted into a string enumeration
  - an array of strings, which is being converted into a string enumeration

### asMap

    public static java.util.Map asMap(java.util.Map pMap)

  Converts the given map into a string array map: The map values are string arrays.

### addMapValue

    protected void addMapValue(java.util.Map pMap,
                               java.lang.String pName,
                               java.lang.String pValue)

  Adds a value to the given map.

### convertName

    protected java.lang.String convertName(java.lang.String pName)

  Lower cases the given name.

### getValue

    public java.lang.String getValue(java.lang.String pName)

  Returns the requested value.

### getValues

    public java.lang.String[] getValues(java.lang.String pName)

  Returns the requested values as a string array.

### getValueEnum

    public java.util.Enumeration getValueEnum(java.lang.String pName)

  Returns the requested values as an enumeration.

### getNames

    public java.util.Enumeration getNames()

  Returns the set of registered names as an enumeration.

  See Also:
    `getNameArray()`

### getMap

    public java.util.Map getMap()

  Returns an unmodifiable map of name/value pairs. The map keys are the lower cased parameter/header names. The map values are string arrays.

### addValue

    public void addValue(java.lang.String pName,
                         java.lang.String pValue)

  Adds a new name/value pair.

### getNameArray

    public java.lang.String[] getNameArray()

  Returns the set of registered names.

  See Also:
    `getNames()`

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 © 2004-2008 The Apache Software Foundation. All Rights Reserved.