Class 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 value
      SomQmgrAttribute​(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 boolean
      java.lang.Double getDoubleVal()
      Get a double value for the attribute
      java.lang.Integer getIntegerVal()
      Get an integer value for the attribute
      java.lang.String getStringVal()
      Get raw string value for attribute
      int getType()
      Get type of attribute as integer
      java.lang.String getTypeString()
      Get attribute type as string
      java.lang.String print()
      Print attribute type/value pair
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 null
        v - 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 value
        v - 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