Class MsgReplacementParameter

  • All Implemented Interfaces:
    java.io.Serializable

    public class MsgReplacementParameter
    extends java.lang.Object
    implements java.io.Serializable
    When creating a message the text might be created by replacing parameters (or placeholders) with concrete values, e.g. "The sum insured must be at least {minSumInsured}." where {minSumInsured} is replaced with the current minimum e.g. 200 Euro. If you need to represent the user a different text, you need the actual value for the parameter. To archieve this the message holds the parameters along with their actual value.

    The following are scenarios where you might need to present a different text for a message:

    • You have limited space available for the text, for example if your display is a terminal.
    • You present the text to a different user group, e.g. internet users instead of your backoffice employees.
    Author:
    Jan Ortmann
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MsgReplacementParameter​(java.lang.String paramName, java.lang.Object paramValue)
      Creates a new parameter value with name and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getName()
      Returns the parameter's name.
      java.lang.Object getValue()
      Returns the parameter's value.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MsgReplacementParameter

        public MsgReplacementParameter​(java.lang.String paramName,
                                       java.lang.Object paramValue)
        Creates a new parameter value with name and value.
        Throws:
        java.lang.NullPointerException - if paramName is null.
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the parameter's name. This method never returns null.
      • getValue

        public java.lang.Object getValue()
        Returns the parameter's value.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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