pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.request
Class Parameter

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.service.request.Parameter
All Implemented Interfaces:
java.io.Serializable, JDOMable, INamed

@Entity
public class Parameter
extends AbstractBasicEntity
implements INamed, JDOMable

is an entity representing a Parameter which may have a set of values.

A Parameter consists of the following attributes:

Version:
$Revision: 1956 $
Author:
Christian Schatt, Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected Parameter()
          Deprecated. 
  Parameter(java.lang.String newName)
          The Constructor that sets the name of the Parameter.
  Parameter(java.lang.String newName, java.util.List<java.lang.String> newValues)
          The Constructor that sets name and values of this Parameter.
  Parameter(java.lang.String newName, java.lang.String newValue)
          The Constructor that sets name and value of this Parameter.
 
Method Summary
 void addAllValues(java.util.Collection<? extends java.lang.String> vals)
          Adds a Collection of values to the Parameter's List of values.
 void addValue(java.lang.String val)
          Adds a value to the Parameter's List of values.
 boolean containsAllValues(java.util.Collection<? extends java.lang.String> vals)
          Determines if all elements of a Collection of values are part of the Parameter's List of values.
 boolean containsValue(java.lang.String val)
          Determines if a value is part of the Parameter's List of values.
 Parameter createCopy()
          returns a copy of the Parameter.
 org.jdom.Element deserializeToJDOM()
          Serializes the state of the Parameter as a JDOM Element.
 boolean equals(java.lang.Object object)
          Checks if the Parameter is equal to the parameter object.
 java.lang.String getFirstValue()
          Returns the first value of the Parameter's List of values.
 java.lang.String getName()
          Returns the name of the Parameter.
 java.util.List<java.lang.String> getValues()
          Returns the List of values of the Parameter.
 int hashCode()
          Returns a hashCode for the Parameter.
 boolean removeAllValues(java.util.Collection<? extends java.lang.String> vals)
          Removes all elements of a Collection of values from the Parameter's List of values if they are part of it.
 boolean removeValue(java.lang.String val)
          Removes a value from the Parameter's List of values if it is part of it.
protected  void setName(java.lang.String newName)
          Sets the name of the Parameter.
 void setValues(java.util.Collection<? extends java.lang.String> newValues)
          Sets the Parameter's List of values.
 java.lang.String toString()
          returns a human readable string representation of the Parameter.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, getFullQualifiedClassNameJAXB, getId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

@Deprecated
protected Parameter()
Deprecated. 

used for HibernateTM.


Parameter

public Parameter(java.lang.String newName)
The Constructor that sets the name of the Parameter.

Parameters:
newName - the name of the Parameter

Parameter

public Parameter(java.lang.String newName,
                 java.lang.String newValue)
The Constructor that sets name and value of this Parameter.

Parameters:
newName - the name of the Parameter
newValue - the value of the Parameter

Parameter

public Parameter(java.lang.String newName,
                 java.util.List<java.lang.String> newValues)
The Constructor that sets name and values of this Parameter.

Parameters:
newName - the name of the Parameter
newValues - the values of the Parameter
Method Detail

getName

public final java.lang.String getName()
Returns the name of the Parameter.

Specified by:
getName in interface INamed
Returns:
the name of the Parameter

setName

protected final void setName(java.lang.String newName)
Sets the name of the Parameter.

Parameters:
newName - the new name of the Parameter

getValues

public final java.util.List<java.lang.String> getValues()
Returns the List of values of the Parameter.

Returns:
the List of values of the Parameter

setValues

public final void setValues(java.util.Collection<? extends java.lang.String> newValues)
Sets the Parameter's List of values.

Parameters:
newValues - the new List of values of the Parameter

getFirstValue

public final java.lang.String getFirstValue()
Returns the first value of the Parameter's List of values.

Returns:
the first value of the Parameter's List of values or an empty string

addValue

public final void addValue(java.lang.String val)
Adds a value to the Parameter's List of values.

Parameters:
val - the value to be added

addAllValues

public final void addAllValues(java.util.Collection<? extends java.lang.String> vals)
Adds a Collection of values to the Parameter's List of values.

Parameters:
vals - the values to be added

containsValue

public final boolean containsValue(java.lang.String val)
Determines if a value is part of the Parameter's List of values.

Parameters:
val - the value to be sought-after
Returns:
true if the value is part of the List

containsAllValues

public final boolean containsAllValues(java.util.Collection<? extends java.lang.String> vals)
Determines if all elements of a Collection of values are part of the Parameter's List of values.

Parameters:
vals - the values to be sought-after
Returns:
true if all values are part of the List

removeValue

public final boolean removeValue(java.lang.String val)
Removes a value from the Parameter's List of values if it is part of it.

Parameters:
val - the value to be removed
Returns:
true if the List changed as a result of the call

removeAllValues

public final boolean removeAllValues(java.util.Collection<? extends java.lang.String> vals)
Removes all elements of a Collection of values from the Parameter's List of values if they are part of it.

Parameters:
vals - the values to be removed
Returns:
true if the List changed as a result of the call

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM()
Serializes the state of the Parameter as a JDOM Element.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
the state of the Parameter as a JDOM Element

equals

public final boolean equals(java.lang.Object object)
Checks if the Parameter is equal to the parameter object. Parameters are equal, if their names are equal and their Lists of values contain the same elements.

Overrides:
equals in class AbstractBasicEntity
Parameters:
object - the Object to be checked for equality with the Parameter
Returns:
true if the parameter object equals the Parameter

hashCode

public final int hashCode()
Returns a hashCode for the Parameter.

Overrides:
hashCode in class AbstractBasicEntity
Returns:
a hashCode for the Parameter
See Also:
AbstractBasicEntity.hashCode()

toString

public java.lang.String toString()
returns a human readable string representation of the Parameter.

Overrides:
toString in class java.lang.Object
Returns:
a human readable string representation

createCopy

public final Parameter createCopy()
returns a copy of the Parameter.

Returns:
the copied parameter