com.buildforge.services.common.dbo
Class SelectorPropertyDBO

java.lang.Object
  extended by com.buildforge.services.common.dbo.DBObject
      extended by com.buildforge.services.common.dbo.SelectorPropertyDBO

public class SelectorPropertyDBO
extends DBObject

Database information representing a single selection condition (property) within a selector definition.


Nested Class Summary
static class SelectorPropertyDBO.Operator
          Valid operators for selector conditions.
 
Field Summary
static java.lang.String TYPE_KEY
           
 
Constructor Summary
SelectorPropertyDBO()
           
SelectorPropertyDBO(java.lang.String newSelectorId, java.lang.String newPropertyName, java.lang.String newPropertyValue, SelectorPropertyDBO.Operator newOperator, boolean newRequired)
           
 
Method Summary
 SelectorPropertyDBO clone()
           
 boolean equals(java.lang.Object obj)
           
 SelectorPropertyDBO fromArray(java.lang.Object[] data)
          Deserialize the database object's settings from a request array.
 java.lang.String getLivePropertyName()
           
 SelectorPropertyDBO.Operator getOperator()
           
 java.lang.String getPropertyName()
           
 java.lang.String getPropertyValue()
           
 boolean getRequired()
           
 java.lang.String getSelectorId()
           
 java.lang.String getTypeKey()
          Retrieve the key that should be used to look up the display name for a data type.
 int hashCode()
           
 boolean isLive()
          Checks whether or not the object is live.
static void sanityCheckPropertyName(java.lang.String propertyName)
           
static void sanityCheckSelector(java.lang.String thisSelectorId)
           
 void setLivePropertyName(java.lang.String newLivePropertyName)
           
 void setOperator(SelectorPropertyDBO.Operator newOperator)
           
 void setPropertyName(java.lang.String newPropertyName)
           
 void setPropertyValue(java.lang.String newPropertyValue)
           
 void setRequired(boolean newRequired)
           
 void setSelectorId(java.lang.String selectorId)
           
 java.lang.Object[] toArray()
          Serializes this database object as an array of objects.
 java.lang.String toString()
           
 
Methods inherited from class com.buildforge.services.common.dbo.DBObject
badId, badName, checkDead, checkLive, collision, collision
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_KEY

public static final java.lang.String TYPE_KEY
See Also:
Constant Field Values
Constructor Detail

SelectorPropertyDBO

public SelectorPropertyDBO()

SelectorPropertyDBO

public SelectorPropertyDBO(java.lang.String newSelectorId,
                           java.lang.String newPropertyName,
                           java.lang.String newPropertyValue,
                           SelectorPropertyDBO.Operator newOperator,
                           boolean newRequired)
Method Detail

getTypeKey

public java.lang.String getTypeKey()
Description copied from class: DBObject
Retrieve the key that should be used to look up the display name for a data type.

Specified by:
getTypeKey in class DBObject
Returns:
the type key for this object's class

isLive

public boolean isLive()
Description copied from class: DBObject
Checks whether or not the object is live. Note that this is not valid for object types that do not have a unique identifier. Those for which no reasonable implementation exists should always return false.

Specified by:
isLive in class DBObject
Returns:
true iff liveness is a valid concept for this object, and the object is live; otherwise, false is returned.

getOperator

public SelectorPropertyDBO.Operator getOperator()

getPropertyName

public java.lang.String getPropertyName()

getPropertyValue

public java.lang.String getPropertyValue()

getRequired

public boolean getRequired()

getSelectorId

public java.lang.String getSelectorId()

getLivePropertyName

public java.lang.String getLivePropertyName()

setOperator

public void setOperator(SelectorPropertyDBO.Operator newOperator)

setPropertyName

public void setPropertyName(java.lang.String newPropertyName)

setPropertyValue

public void setPropertyValue(java.lang.String newPropertyValue)

setRequired

public void setRequired(boolean newRequired)

setSelectorId

public void setSelectorId(java.lang.String selectorId)

setLivePropertyName

public void setLivePropertyName(java.lang.String newLivePropertyName)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

fromArray

public SelectorPropertyDBO fromArray(java.lang.Object[] data)
                              throws APIException
Description copied from class: DBObject
Deserialize the database object's settings from a request array. This method is used to reconstruct a database object from the array that was created by DBObject.toArray().

Specified by:
fromArray in class DBObject
Parameters:
data - the object list that renders this object
Returns:
this object, for convenience
Throws:
APIException - if there is something wrong with the serialized data that interferes with the reconstruction of the object. The most obvious reason for this would be if the serialized array contains the wrong number of fields or otherwise does not match the serialized form for this type of database object.

toArray

public java.lang.Object[] toArray()
Description copied from class: DBObject
Serializes this database object as an array of objects. As specified in the description for Protocol, all supported protocols transfer database objects in this form.

Specified by:
toArray in class DBObject

sanityCheckSelector

public static void sanityCheckSelector(java.lang.String thisSelectorId)
                                throws APIException
Throws:
APIException

sanityCheckPropertyName

public static void sanityCheckPropertyName(java.lang.String propertyName)
                                    throws APIException
Throws:
APIException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public SelectorPropertyDBO clone()
Overrides:
clone in class java.lang.Object