Class FlagValueChangeEvent

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LDValue getNewValue()
      Returns the new value of the flag for the specified evaluation context.
      LDValue getOldValue()
      Returns the last known value of the flag for the specified evaluation context prior to the update.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlagValueChangeEvent

        public FlagValueChangeEvent​(java.lang.String key,
                                    LDValue oldValue,
                                    LDValue newValue)
        Constructs a new instance.
        Parameters:
        key - the feature flag key
        oldValue - the previous flag value
        newValue - the new flag value
    • Method Detail

      • getOldValue

        public LDValue getOldValue()
        Returns the last known value of the flag for the specified evaluation context prior to the update.

        Since flag values can be of any JSON data type, this is represented as LDValue. That class has methods for converting to a primitive Java type such as LDValue.booleanValue().

        If the flag did not exist before or could not be evaluated, this will be LDValue.ofNull(). Note that there is no application default value parameter as there is for the variation methods; it is up to your code to substitute whatever fallback value is appropriate.

        Returns:
        the previous flag value
      • getNewValue

        public LDValue getNewValue()
        Returns the new value of the flag for the specified evaluation context.

        Since flag values can be of any JSON data type, this is represented as LDValue. That class has methods for converting to a primitive Java type such LDValue.booleanValue().

        If the flag was deleted or could not be evaluated, this will be LDValue.ofNull(). Note that there is no application default value parameter as there is for the variation methods; it is up to your code to substitute whatever fallback value is appropriate.

        Returns:
        the new flag value