things.data
Class NVImmutable

java.lang.Object
  extended by things.data.NVImmutable
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NV

public class NVImmutable
extends java.lang.Object
implements java.io.Serializable

This is a name/value pair as strings.

A value can be more than one item.

Version:
1.0

Version History

EPG - Rewrite from another project - 22 MAY 04
 
Author:
Erich P. Gatejen
See Also:
Serialized Form

Field Summary
protected  java.lang.String name
          The Name.
protected  java.lang.String[] value
          The Values
 
Constructor Summary
NVImmutable(java.lang.String n)
          Setting constructor with no value.
NVImmutable(java.lang.String n, java.lang.String... v)
          Setting constructor.
NVImmutable(java.lang.String n, java.lang.String v)
          Setting constructor.
 
Method Summary
 java.lang.String[] getFlat()
          Get flat.
 java.lang.String getName()
          Get the name.
 java.lang.String getValue()
          Get the first (and perhaps only) value.
 java.lang.String[] getValues()
          Get all the values as an array.
 java.util.List<java.lang.String> getValuesAsList()
          Get all the values as a List.
 boolean isMultivalue()
          Is multivalue.
 boolean isValid()
          Validate.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The Name.


value

protected java.lang.String[] value
The Values

Constructor Detail

NVImmutable

public NVImmutable(java.lang.String n)
Setting constructor with no value. The value will be the same as the name.

Parameters:
n - the name

NVImmutable

public NVImmutable(java.lang.String n,
                   java.lang.String v)
Setting constructor.

Parameters:
n - the name
v - the value

NVImmutable

public NVImmutable(java.lang.String n,
                   java.lang.String... v)
Setting constructor.

Parameters:
n - the name
v - the value
Method Detail

getName

public java.lang.String getName()
Get the name.

Returns:
Returns the name.

getValue

public java.lang.String getValue()
Get the first (and perhaps only) value. If the value is null, it will return null.

Returns:
The value.

getFlat

public java.lang.String[] getFlat()
Get flat. Name and values in a singel array.

Returns:
The name and values (the name is first).

getValues

public java.lang.String[] getValues()
Get all the values as an array.

Returns:
An array of values.

getValuesAsList

public java.util.List<java.lang.String> getValuesAsList()
Get all the values as a List.

Returns:
a List of the contents.

isMultivalue

public boolean isMultivalue()
Is multivalue.

Returns:
true if it has more than one item for the value, otherwise false.

isValid

public boolean isValid()
Validate. It will make sure the fields are not null.

Returns:
true if valid, otherwise false.

toString

public java.lang.String toString()
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object.

Overrides:
toString in class java.lang.Object
Returns:
the textual representation.


Things.