org.jboss.portal.common.value
Interface Value

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractValue, AbstractValues, BooleanValue, BooleanValues, IntegerValue, IntegerValues, NullValue, StringValue, StringValues

public interface Value
extends java.io.Serializable

A read only interface used to retrieve data. It represents both for mono value and multi values. It must implement equals and hashCode. The semantics : | Storage | mono | multi | | xxx | xxx | [xxx] | | null | null | [null] | -------------------------------- | [] | null | [] | | [null,..] | null | [null,..] | | ["1",..] | "1" | ["1",..] |


Method Summary
 boolean asBoolean()
          Return the value as a boolean.
 boolean[] asBooleanArray()
          Return the values as an array of boolean.
 int asInt()
          Return the value as an int.
 int[] asIntArray()
          Return the values as an array of int.
 java.lang.Object asObject()
          Return the value.
 java.lang.Object[] asObjectArray()
          Return the values as an array of converted object.
 java.util.List asObjectList()
          Return the values as an immutable collection of converted object or null.
 java.lang.String asString()
          Return the value as a string.
 java.lang.String[] asStringArray()
          Return the values as an array of string.
 boolean isMultiValued()
          Return true if it contains more than one value.
 boolean isNull()
          Return true if the value is null.
 

Method Detail

isNull

boolean isNull()
Return true if the value is null.


asString

java.lang.String asString()
Return the value as a string.


asInt

int asInt()
          throws NullConversionException,
                 FormatConversionException
Return the value as an int.

Throws:
NullConversionException - if one of the values is null
FormatConversionException - if one of the values cannot be converted

asBoolean

boolean asBoolean()
                  throws NullConversionException,
                         FormatConversionException
Return the value as a boolean.

Throws:
NullConversionException - if one of the values is null
FormatConversionException - if one of the values cannot be converted

asObject

java.lang.Object asObject()
Return the value.


isMultiValued

boolean isMultiValued()
Return true if it contains more than one value.


asStringArray

java.lang.String[] asStringArray()
Return the values as an array of string.


asIntArray

int[] asIntArray()
                 throws NullConversionException,
                        FormatConversionException
Return the values as an array of int.

Throws:
NullConversionException - if one of the values is null
FormatConversionException - if one of the values cannot be converted

asBooleanArray

boolean[] asBooleanArray()
                         throws NullConversionException,
                                FormatConversionException
Return the values as an array of boolean.

Throws:
NullConversionException - if one of the values is null
FormatConversionException - if one of the values cannot be converted

asObjectArray

java.lang.Object[] asObjectArray()
Return the values as an array of converted object.


asObjectList

java.util.List asObjectList()
Return the values as an immutable collection of converted object or null.