Package com.isode.som.qmgr.objects
Class SomQmgrAttribute
java.lang.Object
com.isode.som.qmgr.objects.SomQmgrAttribute
This class models an individual SOM attribute - a type/value string pair
- Author:
- tc
-
Constructor Summary
ConstructorsConstructorDescriptionSomQmgrAttribute
(int t, String v) Create a new Attribute, with a given type and valueSomQmgrAttribute
(String t, String v) Create a new Attribute, with a given type and value -
Method Summary
Modifier and TypeMethodDescriptionboolean
compareTo
(int newtype) Test whether this attribute's type matches some other type.boolean
Get attribute value as booleanGet a double value for the attributeGet an integer value for the attributeGet raw string value for attributeint
getType()
Get type of attribute as integerGet attribute type as stringprint()
Print attribute type/value pair
-
Constructor Details
-
SomQmgrAttribute
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
Create a new Attribute, with a given type and value- Parameters:
t
- Type integer valuev
- Value string, which must not be null
-
-
Method Details
-
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
Get an integer value for the attribute- Returns:
- Integer value for attribute value or null
-
getDoubleVal
Get a double value for the attribute- Returns:
- Double value for attribute value or null
-
getStringVal
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
Get attribute type as string- Returns:
- Attribute type as string
-
getBooleanVal
Get attribute value as boolean- Returns:
- true if string value is "1", false otherwise
- Throws:
SomException
- on error
-
print
Print attribute type/value pair- Returns:
- String representation of attribute
-