com.ibm.wsspi.rasdiag

Class DiagnosticTypedValue

  • java.lang.Object
    • com.ibm.wsspi.rasdiag.DiagnosticTypedValue


  • public class DiagnosticTypedValue
    extends java.lang.Object
    Special class for storing typed data in the HashMaps used by DiagnosticProviders. The HashMaps DiagnosticProviders create have keys that are Strings and values that can be:
    • String
    • HashMap (to recursively cascade Diagnostic Data)
    • DiagnosticTypedValue which can be of type:
      • short
      • int
      • boolean
      • double
      • long
      • String
      • Date
    This allows flexibility in content delivered.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static short MAXTYPECONST 
      static java.lang.String[] sTypeNames 
      java.lang.String tvMsgKey
      localization message key representing the label for this value
      java.lang.String tvString
      string representation of value
      short tvType
      type being held in this DTV object
      static short TYPEBOOLEAN
      boolean primitive type
      static short TYPECOLLECTIONEL
      Collection type
      static short TYPEDATE
      Date type
      static short TYPEDOUBLE
      double primitive type
      static short TYPEINT
      int primitive type
      static short TYPELONG
      long primitive type
      static short TYPESHORT
      short primitive type
      static short TYPESTRING
      String type
    • Constructor Summary

      Constructors 
      Constructor and Description
      DiagnosticTypedValue()
      constructs the class with no parms.
      DiagnosticTypedValue(boolean aBoolVal, java.lang.String aMsgKey)
      constructs an object with a boolean value (Helper constructor)
      DiagnosticTypedValue(java.util.Date aDateVal, java.lang.String aMsgKey)
      constructs an object with a date object (Helper constructor)
      DiagnosticTypedValue(double aDoubleVal, java.lang.String aMsgKey)
      constructs an object with a dobule value (Helper constructor)
      DiagnosticTypedValue(int aIntVal, java.lang.String aMsgKey)
      constructs an object with an int value (Helper constructor)
      DiagnosticTypedValue(long aLongVal, java.lang.String aMsgKey)
      constructs an object with a long value (Helper constructor)
      DiagnosticTypedValue(short aShortVal, java.lang.String aMsgKey)
      constructs an object with a short value (Helper constructor)
      DiagnosticTypedValue(java.lang.String aStringVal, java.lang.String aMsgKey)
      constructs an object with a String value (Helper constructor)
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static void addCollectionToHashMap(java.util.HashMap aDest, java.lang.String aId, java.util.Collection aData, java.lang.String aMsgKey)
      adds a collection into the passed in HashMap.
      static void addCollectionToHashMap(java.util.HashMap aDest, java.lang.String aId, java.util.Collection aData, java.lang.String aMsgKey, short collectionType)
      adds a collection into the passed in HashMap.
      static void addHashMap(java.util.HashMap parentHashMap, java.util.HashMap childHashMap, java.lang.String childName)
      add a child Hashmap to a parent Hashmap and give it a name (static Helper method) This is equivalent to calling parentHashMap.put(childName, childHashMap)
      static DiagnosticTypedValue fromString(java.lang.String aDiagType)
      deserialize a string back into this object
      java.lang.String toString()
      convert the object to a string with a colon separated type:value pair
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • TYPEBOOLEAN

        public static final short TYPEBOOLEAN
        boolean primitive type
        See Also:
        Constant Field Values
      • TYPECOLLECTIONEL

        public static final short TYPECOLLECTIONEL
        Collection type
        See Also:
        Constant Field Values
      • sTypeNames

        public static final java.lang.String[] sTypeNames
      • tvType

        public short tvType
        type being held in this DTV object
      • tvString

        public java.lang.String tvString
        string representation of value
      • tvMsgKey

        public java.lang.String tvMsgKey
        localization message key representing the label for this value
    • Constructor Detail

      • DiagnosticTypedValue

        public DiagnosticTypedValue()
        constructs the class with no parms. Since member fields are public, they can be updated directly. This allows construction by the caller
      • DiagnosticTypedValue

        public DiagnosticTypedValue(short aShortVal,
                            java.lang.String aMsgKey)
        constructs an object with a short value (Helper constructor)
        Parameters:
        aShortVal - value to be typed/stored
      • DiagnosticTypedValue

        public DiagnosticTypedValue(int aIntVal,
                            java.lang.String aMsgKey)
        constructs an object with an int value (Helper constructor)
        Parameters:
        aIntVal - value to be typed/stored
      • DiagnosticTypedValue

        public DiagnosticTypedValue(boolean aBoolVal,
                            java.lang.String aMsgKey)
        constructs an object with a boolean value (Helper constructor)
        Parameters:
        aBoolVal - value to be typed/stored
      • DiagnosticTypedValue

        public DiagnosticTypedValue(double aDoubleVal,
                            java.lang.String aMsgKey)
        constructs an object with a dobule value (Helper constructor)
        Parameters:
        aDoubleVal - value to be typed/stored
      • DiagnosticTypedValue

        public DiagnosticTypedValue(long aLongVal,
                            java.lang.String aMsgKey)
        constructs an object with a long value (Helper constructor)
        Parameters:
        aLongVal - value to be typed/stored
      • DiagnosticTypedValue

        public DiagnosticTypedValue(java.lang.String aStringVal,
                            java.lang.String aMsgKey)
        constructs an object with a String value (Helper constructor)
        Parameters:
        aStringVal - value to be typed/stored
      • DiagnosticTypedValue

        public DiagnosticTypedValue(java.util.Date aDateVal,
                            java.lang.String aMsgKey)
        constructs an object with a date object (Helper constructor)
        Parameters:
        aDateVal - value to be typed/stored
    • Method Detail

      • toString

        public java.lang.String toString()
        convert the object to a string with a colon separated type:value pair
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representing the object. If tvType is invalid, returns null.
      • fromString

        public static DiagnosticTypedValue fromString(java.lang.String aDiagType)
        deserialize a string back into this object
        Parameters:
        aDiagType - String representation of the object (from toString())
        Returns:
        DiagnosticTypedValue instance from the string
      • addCollectionToHashMap

        public static void addCollectionToHashMap(java.util.HashMap aDest,
                                  java.lang.String aId,
                                  java.util.Collection aData,
                                  java.lang.String aMsgKey)
        adds a collection into the passed in HashMap. It creates multiple DiagnosticTypedValue entries in the HashMap with the id suffixed by a sequence number. The same MsgKey is used for all as they are assumed to be the same type of data.
        Parameters:
        aDest - Destination HashMap into which all of the entries in the collection will be added
        aId - Id/Name of the collection which will be suffixed by a sequence number and used as the HashMap key collection as the type of data which is stored in the DiagnosticTypedValue
        aData - Actual collection containing the data (or something subclassed off of collection)
        aMsgKey - Key into a Resource Bundle for localizing the label
      • addCollectionToHashMap

        public static void addCollectionToHashMap(java.util.HashMap aDest,
                                  java.lang.String aId,
                                  java.util.Collection aData,
                                  java.lang.String aMsgKey,
                                  short collectionType)
        adds a collection into the passed in HashMap. It creates multiple DiagnosticTypedValue entries in the HashMap with the id suffixed by a sequence number. The same MsgKey is used for all as they are assumed to be the same type of data.
        Parameters:
        aDest - Destination HashMap into which all of the entries in the collection will be added
        aId - Id/Name of the collection which will be suffixed by a sequence number and used as the HashMap key collection as the type of data which is stored in the DiagnosticTypedValue
        aData - Actual collection containing the data (or something subclassed off of collection)
        aMsgKey - Key into a Resource Bundle for localizing the label
        collectionType - the type of each object in the collection (should be specified from the TYPE* constants in this file). If not valid, String will be used.
      • addHashMap

        public static void addHashMap(java.util.HashMap parentHashMap,
                      java.util.HashMap childHashMap,
                      java.lang.String childName)
        add a child Hashmap to a parent Hashmap and give it a name (static Helper method) This is equivalent to calling parentHashMap.put(childName, childHashMap)
        Parameters:
        parentHashMap - Parent HashMap, will contain Child HashMap
        childHashMap - Child HashMap to embed into Parent HashMap
        childName - Name of Child HashMap for display
IBM WebSphere Application ServerTM
Release 9.0