org.rhq.core.domain.configuration
Class PropertySimple

java.lang.Object
  extended by org.rhq.core.domain.configuration.Property
      extended by org.rhq.core.domain.configuration.PropertySimple
All Implemented Interfaces:
Serializable, Comparable<Property>, DeepCopyable<Property>

public class PropertySimple
extends Property
implements Serializable

This type of Property stores a simple Java primitive value in string form. Null values are allowed.

See Also:
Serialized Form

Field Summary
static int MAX_VALUE_LENGTH
           
 
Fields inherited from class org.rhq.core.domain.configuration.Property
QUERY_DELETE_BY_PROPERTY_IDS
 
Constructor Summary
  PropertySimple()
          Constructor for PropertySimple that stores a null value.
protected PropertySimple(PropertySimple original, boolean keepId)
           
  PropertySimple(String name, Object value)
          Constructs a property that has the given name with the given value.
 
Method Summary
protected  void appendToStringInternals(StringBuilder str)
          Subclasses can override this to add things it wants to see in the toString.
 PropertySimple deepCopy(boolean keepId)
           
 boolean equals(Object obj)
           
 Boolean getBooleanValue()
          Returns this property value as a Boolean.
 Double getDoubleValue()
          Returns this property value as a Double.
 Float getFloatValue()
          Returns this property value as a Float.
 Integer getIntegerValue()
          Returns this property value as a Integer.
 Long getLongValue()
          Returns this property value as a Long.
 Boolean getOverride()
           
 String getStringValue()
          Returns the value (in string form) of this property, which may be null.
 int hashCode()
           
 boolean isMasked()
           
 void mask()
           
 void setBooleanValue(Boolean value)
          Sets the value of this property to the toString form of the given value.
 void setDoubleValue(Double value)
          Sets the value of this property to the toString form of the given value.
 void setFloatValue(Float value)
          Sets the value of this property to the toString form of the given value.
 void setIntegerValue(Integer value)
          Sets the value of this property to the toString form of the given value.
 void setLongValue(Long value)
          Sets the value of this property to the toString form of the given value.
 void setOverride(Boolean override)
           
 void setStringValue(String value)
          Sets the value of this property to the given value.
 void setValue(Object value)
          Sets the value of this property to the toString form of the given value.
 
Methods inherited from class org.rhq.core.domain.configuration.Property
compareTo, getConfiguration, getErrorMessage, getId, getName, getParentList, getParentMap, setConfiguration, setErrorMessage, setId, setName, setParentList, setParentMap, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_VALUE_LENGTH

public static final int MAX_VALUE_LENGTH
See Also:
Constant Field Values
Constructor Detail

PropertySimple

public PropertySimple()
Constructor for PropertySimple that stores a null value. NOTE: When using this constructor, you need to supply a name via #setName manually.


PropertySimple

protected PropertySimple(PropertySimple original,
                         boolean keepId)

PropertySimple

public PropertySimple(@NotNull
                      String name,
                      @Nullable
                      Object value)
Constructs a property that has the given name with the given value. The value's toString representation will be stored in this object - value itself will not be stored (that is, this object will not hold a reference to value).

Parameters:
name -
value -
Method Detail

setValue

public void setValue(@Nullable
                     Object value)
Sets the value of this property to the toString form of the given value. This object will not hold a reference to value.

Parameters:
value -

getStringValue

@Nullable
public String getStringValue()
Returns the value (in string form) of this property, which may be null.

This may return null

Returns:
string form of the property value

setStringValue

public void setStringValue(@Nullable
                           String value)
Sets the value of this property to the given value.

Calling this method is the same as if calling setValue(Object).

Parameters:
value -

getBooleanValue

@Nullable
public Boolean getBooleanValue()
Returns this property value as a Boolean. See Boolean.parseBoolean(String) for the behavior of this method.

This may return null

Returns:
the value as a Boolean

setBooleanValue

public void setBooleanValue(@Nullable
                            Boolean value)
Sets the value of this property to the toString form of the given value. This object will not hold a reference to the value.

Calling this method is the same as if calling setValue(Object).

Parameters:
value -

getLongValue

@Nullable
public Long getLongValue()
Returns this property value as a Long. See Long.parseLong(String) for the behavior of this method.

This may return null

Returns:
the value as a Long

setLongValue

public void setLongValue(@Nullable
                         Long value)
Sets the value of this property to the toString form of the given value. This object will not hold a reference to the value.

Calling this method is the same as if calling setValue(Object).

Parameters:
value -

getIntegerValue

@Nullable
public Integer getIntegerValue()
Returns this property value as a Integer. See Integer.parseInt(String) for the behavior of this method.

This may return null

Returns:
the value as an Integer

setIntegerValue

public void setIntegerValue(@Nullable
                            Integer value)
Sets the value of this property to the toString form of the given value. This object will not hold a reference to the value.

Calling this method is the same as if calling setValue(Object).

Parameters:
value -

getFloatValue

@Nullable
public Float getFloatValue()
Returns this property value as a Float. See Float.parseFloat(String) for the behavior of this method.

This may return null

Returns:
the value as a Float

setFloatValue

public void setFloatValue(@Nullable
                          Float value)
Sets the value of this property to the toString form of the given value. This object will not hold a reference to the value.

Calling this method is the same as if calling setValue(Object).

Parameters:
value -

getDoubleValue

@Nullable
public Double getDoubleValue()
Returns this property value as a Double. See Double.parseDouble(String) for the behavior of this method.

This may return null

Returns:
the value as a Double

setDoubleValue

public void setDoubleValue(@Nullable
                           Double value)
Sets the value of this property to the toString form of the given value. This object will not hold a reference to the value.

Calling this method is the same as if calling setValue(Object).

Parameters:
value -

getOverride

public Boolean getOverride()

setOverride

public void setOverride(Boolean override)

isMasked

public boolean isMasked()

mask

public void mask()

equals

public boolean equals(Object obj)
Overrides:
equals in class Property

hashCode

public int hashCode()
Overrides:
hashCode in class Property

deepCopy

public PropertySimple deepCopy(boolean keepId)
Specified by:
deepCopy in interface DeepCopyable<Property>
Overrides:
deepCopy in class Property

appendToStringInternals

protected void appendToStringInternals(StringBuilder str)
Description copied from class: Property
Subclasses can override this to add things it wants to see in the toString.

Overrides:
appendToStringInternals in class Property
Parameters:
str - the builder to append strings to


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.