com.ibm.itim.common

Class Badge

  • java.lang.Object
    • com.ibm.itim.common.Badge
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Badge>


    public class Badge
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<Badge>
    Class to represent a special label with associated display style information
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      Badge()
      Default constructor
      Badge(java.lang.String badgeValueSpecification)
      Special constructor to parse the given string according to badge value specification.
      Badge(java.lang.String key, java.lang.String style)
      Constructor
    • Field Detail

      • BADGE_PROPERTIES_FILE

        public static final java.lang.String BADGE_PROPERTIES_FILE
        See Also:
        Constant Field Values
      • SPECIFICATION_DELIMITER

        public static final java.lang.String SPECIFICATION_DELIMITER
        See Also:
        Constant Field Values
    • Constructor Detail

      • Badge

        public Badge()
        Default constructor
      • Badge

        public Badge(java.lang.String key,
                     java.lang.String style)
        Constructor
        Parameters:
        badge - text - key of badge text defined in Badge.properties file
        style - formatting - I.e: CSS formatting
      • Badge

        public Badge(java.lang.String badgeValueSpecification)
        Special constructor to parse the given string according to badge value specification.
        Parameters:
        badgeValueSpecification -
    • Method Detail

      • getKey

        public java.lang.String getKey()
      • setKey

        public void setKey(java.lang.String key)
      • getBadgeTextFromPropertyFile

        public static java.lang.String getBadgeTextFromPropertyFile(java.lang.String key)
        Method to read the label from property file.
        Parameters:
        key -
        Returns:
      • parseBadgeValueSpecification

        public static Badge parseBadgeValueSpecification(java.lang.String badgeValueSpecification)
        Parse given value which is expected to be formatted in the following way: ~ This means that the tilde character '~' is disallowed in both and parts of the value;
        Parameters:
        badgeValueSpecification -
        Returns:
        Badge object
      • composeBadgeSpecification

        public static java.lang.String composeBadgeSpecification(Badge badge)
        This method takes the designation and generates the key from designation. This is used to then create a key to composes badge designation.
        Parameters:
        badge -
        Returns:
      • composeBadgeSpecification

        public static java.lang.String composeBadgeSpecification(java.lang.String designation,
                                                                 java.lang.String style)
      • getDesignation

        public java.lang.String getDesignation()
      • setDesignation

        public void setDesignation(java.lang.String designation)
      • getStyle

        public java.lang.String getStyle()
      • setStyle

        public void setStyle(java.lang.String style)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo(Badge o)
        Specified by:
        compareTo in interface java.lang.Comparable<Badge>