org.dasein.attributes.types
Class NameValuePairFactory.NameValuePairAttribute

java.lang.Object
  extended by org.dasein.attributes.DataType<NameValuePair>
      extended by org.dasein.attributes.types.NameValuePairFactory.NameValuePairAttribute
All Implemented Interfaces:
Serializable
Enclosing class:
NameValuePairFactory

public static class NameValuePairFactory.NameValuePairAttribute
extends DataType<NameValuePair>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dasein.attributes.DataType
DataType.InputType
 
Constructor Summary
NameValuePairFactory.NameValuePairAttribute(boolean ml, boolean mv, boolean req)
           
 
Method Summary
 Collection<NameValuePair> getChoices()
          Provides a list of values considered valid for this data type.
 DataTypeFactory<NameValuePair> getFactory()
           
 DataType.InputType getInputType()
           
 NameValuePair getValue(Object val)
          Implementors will implement this method to convert a raw value into a valid value of this data type.
 boolean isValidChoice(NameValuePair pair)
           Checks the specified value to see if it is valid for this data type.
 String toString()
           
 
Methods inherited from class org.dasein.attributes.DataType
equals, getName, getParameters, getSize, getTranslatedValue, getValues, hashCode, isMultiLingual, isMultiValued, isRequired
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameValuePairFactory.NameValuePairAttribute

public NameValuePairFactory.NameValuePairAttribute(boolean ml,
                                                   boolean mv,
                                                   boolean req)
Method Detail

getChoices

public Collection<NameValuePair> getChoices()
Description copied from class: DataType
Provides a list of values considered valid for this data type. If any object of the type governed by this data type is allowed, this method will return null.

Specified by:
getChoices in class DataType<NameValuePair>
Returns:
a list of allowed values or null to allow any value

getFactory

public DataTypeFactory<NameValuePair> getFactory()
Specified by:
getFactory in class DataType<NameValuePair>
Returns:
the factory object that owns this data type

getInputType

public DataType.InputType getInputType()
Specified by:
getInputType in class DataType<NameValuePair>
Returns:
the type of input that a user interface should provide to prompt a user for a value

getValue

public NameValuePair getValue(Object val)
Description copied from class: DataType
Implementors will implement this method to convert a raw value into a valid value of this data type. Implementations should throw an InvalidAttributeException if they are unable to interpret the raw value.

Specified by:
getValue in class DataType<NameValuePair>
Parameters:
val - the raw value, such as user input or a string from a persistent store
Returns:
a converted value of this data type

isValidChoice

public boolean isValidChoice(NameValuePair pair)
Description copied from class: DataType

Checks the specified value to see if it is valid for this data type. In general, implementing classes will check the following:

Specified by:
isValidChoice in class DataType<NameValuePair>
Parameters:
pair - the value being validated
Returns:
true if the value is valid for this data type

toString

public String toString()
Overrides:
toString in class DataType<NameValuePair>
Returns:
a string representation of this data type