Package com.isode.som.qmgr.objects
Class SomQmgrAttribute
- java.lang.Object
-
- com.isode.som.qmgr.objects.SomQmgrAttribute
-
public class SomQmgrAttribute extends java.lang.Object
This class models an individual SOM attribute - a type/value string pair- Author:
- tc
-
-
Constructor Summary
Constructors Constructor Description SomQmgrAttribute(int t, java.lang.String v)
Create a new Attribute, with a given type and valueSomQmgrAttribute(java.lang.String t, java.lang.String v)
Create a new Attribute, with a given type and value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compareTo(int newtype)
Test whether this attribute's type matches some other type.boolean
getBooleanVal()
Get attribute value as booleanjava.lang.Double
getDoubleVal()
Get a double value for the attributejava.lang.Integer
getIntegerVal()
Get an integer value for the attributejava.lang.String
getStringVal()
Get raw string value for attributeint
getType()
Get type of attribute as integerjava.lang.String
getTypeString()
Get attribute type as stringjava.lang.String
print()
Print attribute type/value pair
-
-
-
Constructor Detail
-
SomQmgrAttribute
public SomQmgrAttribute(java.lang.String t, java.lang.String v)
Create a new Attribute, with a given type and value- Parameters:
t
- Type string, which must not be nullv
- Value string, which must not be null
-
SomQmgrAttribute
public SomQmgrAttribute(int t, java.lang.String v)
Create a new Attribute, with a given type and value- Parameters:
t
- Type integer valuev
- Value string, which must not be null
-
-
Method Detail
-
compareTo
public boolean compareTo(int newtype)
Test whether this attribute's type matches some other type.- Parameters:
newtype
- Type to test against- Returns:
- true if types match
-
getIntegerVal
public java.lang.Integer getIntegerVal()
Get an integer value for the attribute- Returns:
- Integer value for attribute value or null
-
getDoubleVal
public java.lang.Double getDoubleVal()
Get a double value for the attribute- Returns:
- Double value for attribute value or null
-
getStringVal
public java.lang.String getStringVal() throws SomException
Get raw string value for attribute- Returns:
- Attribute value
- Throws:
SomException
- on error
-
getType
public int getType()
Get type of attribute as integer- Returns:
- Integer attribute type (values from SomQmgrAttributeMap)
-
getTypeString
public java.lang.String getTypeString()
Get attribute type as string- Returns:
- Attribute type as string
-
getBooleanVal
public boolean getBooleanVal() throws SomException
Get attribute value as boolean- Returns:
- true if string value is "1", false otherwise
- Throws:
SomException
- on error
-
print
public java.lang.String print()
Print attribute type/value pair- Returns:
- String representation of attribute
-
-