com.croftsoft.core.lang
Class Pair

java.lang.Object
  extended by com.croftsoft.core.lang.Pair
All Implemented Interfaces:
Serializable

public final class Pair
extends Object
implements Serializable

An immutable name-value pair where name is never null.

Java 1.1 compatible.

Since:
2001-06-07
Version:
2001-09-13
See Also:
Serialized Form
Author:
David Wallace Croft

Field Summary
 String name
           
 String value
           
 
Constructor Summary
Pair(String name, String value)
          Constructor method.
 
Method Summary
 String getName()
           
 String getValue()
           
static Pair[] toPairs(String[] names)
          Converts an array of names to an array of Pairs with null values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final String name

value

public final String value
Constructor Detail

Pair

public Pair(String name,
            String value)
Constructor method.

Parameters:
name - Must not be null.
value - May be null.
Throws:
NullArgumentException - If name is null.
Method Detail

getName

public String getName()

getValue

public String getValue()

toPairs

public static Pair[] toPairs(String[] names)
Converts an array of names to an array of Pairs with null values.


CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)