public class AttributeStateHolder
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
ObjectStateHolder
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
XML_ATTR_NAME |
static java.lang.String |
XML_ATTR_OPER |
static java.lang.String |
XML_ATTR_TYPE |
static java.lang.String |
XML_ROOT_ELEMENT_NAME |
Constructor and Description |
---|
AttributeStateHolder(AttributeStateHolder attrSH)
Copy constructor.
|
AttributeStateHolder(Element element)
Constructs an attribute state holder by XML element
|
AttributeStateHolder(java.lang.String name,
CmdbLinkID value)
Constructs an attribute state holder
|
AttributeStateHolder(java.lang.String name,
CmdbObjectID value)
Constructs an attribute state holder
|
AttributeStateHolder(java.lang.String name,
java.lang.Object value)
Constructs an attribute state holder
|
AttributeStateHolder(java.lang.String name,
java.lang.Object value,
int oper)
Constructs an attribute state holder
|
AttributeStateHolder(java.lang.String name,
java.lang.Object value,
int oper,
java.lang.String type)
Constructs an attribute state holder
Use this constructor if the attribute is list and has type
String |
AttributeStateHolder(java.lang.String name,
java.lang.Object value,
java.lang.String type)
Constructs an attribute state holder
Use this constructor if the attribute is list and has type
String |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
bytesToString(byte[] bytes) |
java.lang.Object |
clone()
Returns a clone of this state holder.
|
int |
compareTo(java.lang.Object o)
Compares this attribute state holder to another Object.
|
java.lang.Object |
deepClone()
Returns a deep clone of this state holder.
|
boolean |
equals(java.lang.Object anObject)
Compares this state holder to the specified object.
|
boolean |
getBooleanValue()
Returns the atrtribute value as
Boolean . |
java.util.Date |
getDateValue()
Returns the atrtribute value as
Date . |
double |
getDoubleValue()
Returns the attribute value as
Double . |
int |
getIntegerValue()
Returns the attribute value as
Integer . |
long |
getLongValue()
Returns the atrtribute value as
long . |
java.lang.String |
getName()
Returns the atrtribute name.
|
ObjectStateHolder |
getObjectValue()
Returns the atrtribute value as
Boolean . |
int |
getOperator()
Returns the atrtribute operator.
|
java.lang.String |
getStringValue()
Returns the attribute value as
String . |
java.lang.String |
getType()
Returns the atrtribute type.
|
int |
getTypeInt()
Returns the atrtribute type.
|
java.lang.Object |
getValue()
Returns the atrtribute value.
|
int |
hashCode() |
boolean |
isList() |
void |
setName(java.lang.String attrName)
Sets the atrtribute name.
|
void |
setOperator(int oper)
Sets the atrtribute operator.
|
void |
setType(java.lang.String attrType)
Sets the atrtribute type.
|
void |
setValue(java.lang.Object value)
Sets the atrtribute value.
|
void |
setValue(java.lang.Object value,
java.lang.String type)
Sets the atrtribute value with type.
|
void |
setValueFromString(java.lang.String value)
Sets the attribute value with type.
|
void |
setValueFromString(java.lang.String value,
java.lang.String type)
Sets the atrtribute value with type.
|
static byte[] |
stringToBytes(java.lang.String string) |
java.lang.String |
toString()
Returns attribute representation as straing
|
Element |
toXml()
Returns attribute state holder representation in XML format
|
java.lang.String |
toXmlString()
Returns attribute state holder representation in XML string format
|
java.lang.StringBuffer |
toXmlString(java.lang.StringBuffer xml) |
public static final java.lang.String XML_ROOT_ELEMENT_NAME
public static final java.lang.String XML_ATTR_NAME
public static final java.lang.String XML_ATTR_TYPE
public static final java.lang.String XML_ATTR_OPER
public AttributeStateHolder(java.lang.String name, java.lang.Object value, int oper, java.lang.String type)
String
name
- The attribute namevalue
- The attribute valueoper
- The attribute operatortype
- The attribute typepublic AttributeStateHolder(java.lang.String name, java.lang.Object value, java.lang.String type)
String
name
- The attribute namevalue
- The attribute valuetype
- The attribute typepublic AttributeStateHolder(java.lang.String name, java.lang.Object value, int oper)
name
- The attribute namevalue
- The attribute valuepublic AttributeStateHolder(java.lang.String name, java.lang.Object value)
name
- The attribute namevalue
- The attribute valuepublic AttributeStateHolder(java.lang.String name, CmdbObjectID value)
name
- The attribute namevalue
- The attribute valuepublic AttributeStateHolder(java.lang.String name, CmdbLinkID value)
name
- The attribute namevalue
- The attribute valuepublic AttributeStateHolder(AttributeStateHolder attrSH)
attrSH
- The attribute namepublic AttributeStateHolder(Element element)
element
- The XML elementpublic java.lang.String toString()
toString
in class java.lang.Object
public Element toXml()
public java.lang.String getName()
public void setName(java.lang.String attrName)
attrName
- The attribute namepublic java.lang.String getType()
public int getTypeInt()
public void setType(java.lang.String attrType)
attrType
- The attribute typeAppilogTypes
public int getOperator()
public void setOperator(int oper)
oper
- The attribute operatorpublic boolean isList()
public java.lang.Object getValue()
public void setValue(java.lang.Object value, java.lang.String type)
public void setValue(java.lang.Object value)
public void setValueFromString(java.lang.String value, java.lang.String type)
public void setValueFromString(java.lang.String value)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.Object deepClone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object anObject)
true
if and only if the argument is not
null
and is a AttributeStateHolder
object that represents the same data as this object.equals
in class java.lang.Object
anObject
- the object to compare this AttributeStateHolder
against.true
if the AttributeStateHolder
are equal;
false
otherwise.public int compareTo(java.lang.Object o)
compareTo(AttributeStateHolder)
. Otherwise,
it throws a ClassCastException
(as AttributeStateHolder are comparable
only to other AttributeStateHolders).compareTo
in interface java.lang.Comparable
o
- the Object
to be compared.0
if the argument name is a string
lexicographically equal to this attribute name; a value less than
0
if the argument name is a string lexicographically
greater than this attribute name; and a value greater than
0
if the argument name is a string lexicographically
less than this attribute name.java.lang.ClassCastException
- if the argument is not a
AttributeStateHolder
.Comparable
public int hashCode()
hashCode
in class java.lang.Object
public int getIntegerValue()
Integer
.
Values from type Integer
only can be returned by this method.public long getLongValue()
long
.
Values from type Integer
only can be returned by this method.public double getDoubleValue()
Double
.
Values from type Double
only can be returned by this method.public java.lang.String getStringValue()
String
.
Values from type String
only can be returned by this method.public java.util.Date getDateValue()
Date
.
Values from type Date
only can be returned by this method.public boolean getBooleanValue()
Boolean
.
Values from type Boolean
only can be returned by this method.public ObjectStateHolder getObjectValue()
Boolean
.
Values from type Boolean
only can be returned by this method.public static java.lang.String bytesToString(byte[] bytes)
public static byte[] stringToBytes(java.lang.String string)
public java.lang.String toXmlString()
public java.lang.StringBuffer toXmlString(java.lang.StringBuffer xml)
Documentation Feedback
Copyright 2012 Micro Focus or one of its affiliates.