Class ConstantDisplayValue

java.lang.Object
ch.tocco.nice2.model.base.api.display.ConstantDisplayValue
All Implemented Interfaces:
DisplayValue

public final class ConstantDisplayValue extends Object implements DisplayValue
Static value to display.
  • Constructor Details

    • ConstantDisplayValue

      public ConstantDisplayValue(String value)
  • Method Details

    • getRawData

      public String getRawData()
      Description copied from interface: DisplayValue
      Get the raw-data. This is a string-representation which should indicate what get evaluated. For example in the case of TextResource this would be the key to the resource.
      It should be used for debug and logs only. It should never be used to actually get the value to display.
      Specified by:
      getRawData in interface DisplayValue
      Returns:
      the value, non-null. can be empty
    • evaluate

      public String evaluate()
      Description copied from interface: DisplayValue
      Evaluate the data-in the current-context.
      Specified by:
      evaluate in interface DisplayValue
      Returns:
      the evaluate-result, ready to display
    • canEvaluate

      public boolean canEvaluate()
      Description copied from interface: DisplayValue
      Return if this display-value can be evaluated. If it cannot, the DisplayValue.evaluate()-Method still has to return a string.
      Because this is 'friendly' asking the system if this display value exists, an implementaition may reports this as a value which is optional. For example. The Textresoure-System will add the display-value to the optional-list if this call is made.

      This behind-scenes-notification is not obvious. So maybe this method should be renamed or replaced.
      Specified by:
      canEvaluate in interface DisplayValue
      Returns:
      true/false