Package net.anotheria.anodoc.data
Class StringProperty
- java.lang.Object
-
- net.anotheria.anodoc.data.DataHolder
-
- net.anotheria.anodoc.data.Property
-
- net.anotheria.anodoc.data.StringProperty
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,IBasicStoreableObject,IPlainDataObject
- Direct Known Subclasses:
TextProperty
public class StringProperty extends Property
This property represents a string value.- Version:
- $Id: $Id
- Author:
- another
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringProperty(java.lang.String name)Creates a new StringProperty with given name and null value.StringProperty(java.lang.String name, java.lang.String value)Creates a new StringProperty with given name and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectcloneValue()cloneValue.booleanequals(java.lang.Object obj)Returns true if the given obj is a StringProperty and the name, value tuples are equal.PropertyTypegetPropertyType()getPropertyType.longgetSizeInBytes()The 'size' of a DataHolder is needed for the quota calculation.
The size of an atomic DataHolder like a Property should be the real amount of bytes it uses, whether the size of complex objects should be cumulated.
The overhead for administration shouldn't be counted (i.e.java.lang.StringgetString()Returns the value of this property as String.voidsetString(java.lang.String aString)Sets the value of this property to the given String.voidsetValue(java.lang.Object o)Sets the value of this Property.-
Methods inherited from class net.anotheria.anodoc.data.Property
clone, cloneAs, getName, getStorageId, getValue, toString, toXMLNode
-
Methods inherited from class net.anotheria.anodoc.data.DataHolder
getId, hashCode, setId
-
-
-
-
Constructor Detail
-
StringProperty
public StringProperty(java.lang.String name)
Creates a new StringProperty with given name and null value.- Parameters:
name- aStringobject.
-
StringProperty
public StringProperty(java.lang.String name, java.lang.String value)Creates a new StringProperty with given name and value.- Parameters:
name- aStringobject.value- aStringobject.
-
-
Method Detail
-
getString
public java.lang.String getString()
Returns the value of this property as String.- Returns:
- a
Stringobject.
-
setString
public void setString(java.lang.String aString)
Sets the value of this property to the given String.- Parameters:
aString- aStringobject.
-
setValue
public void setValue(java.lang.Object o)
Sets the value of this Property. Sets the value of this property to the String representation of the given Object o. If o is null, the value of this property will be 'null'.
-
equals
public boolean equals(java.lang.Object obj)
Returns true if the given obj is a StringProperty and the name, value tuples are equal.
-
getSizeInBytes
public long getSizeInBytes()
The 'size' of a DataHolder is needed for the quota calculation.
The size of an atomic DataHolder like a Property should be the real amount of bytes it uses, whether the size of complex objects should be cumulated.
The overhead for administration shouldn't be counted (i.e. the size of an IntProperty is the amount of bytes needed to store the int value itself, not the amount of bytes needed to store the DataHolder object). Returns the amount of bytes needed to save this property.- Specified by:
getSizeInBytesin classDataHolder- Returns:
- a long.
- See Also:
DataHolder.getSizeInBytes()
-
cloneValue
protected java.lang.Object cloneValue()
cloneValue.
- Specified by:
cloneValuein classProperty- Returns:
- a
Objectobject.
-
getPropertyType
public PropertyType getPropertyType()
getPropertyType.
- Specified by:
getPropertyTypein classProperty- Returns:
- a
PropertyTypeobject.
-
-