Class EvalDetail<T>

java.lang.Object
co.featbit.commons.model.EvalDetail<T>
Type Parameters:
T - - String/Boolean/Numeric Type
All Implemented Interfaces:
Serializable

public final class EvalDetail<T> extends Object implements Serializable
An object combines the result of a flag evaluation with an explanation of how it was calculated. This object contains the details of evaluation of feature flag.
See Also:
  • Method Details

    • of

      public static <T> EvalDetail<T> of(T variation, String id, String reason, String keyName, String name)
      build method, this method is only for internal use
      Type Parameters:
      T - String/Boolean/Numeric Type
      Parameters:
      variation -
      id -
      reason -
      keyName -
      name -
      Returns:
      an EvalDetail
    • fromJson

      public static <T> EvalDetail<T> fromJson(String json, Class<T> cls)
      build the method from a json string, this method is only for internal use
      Type Parameters:
      T - String/Boolean/Numeric Type
      Parameters:
      json -
      cls -
      Returns:
      an EvalDetail
    • getVariation

      public T getVariation()
      return a feature flag evaluation value
      Returns:
      the flag value
    • getId

      public String getId()
      The id of the returned value within the flag's list of variations In fact this value is an index, this value is only for internal use
      Returns:
      a integer value
    • getReason

      public String getReason()
      get the reason that evaluate the flag value.
      Returns:
      a string
    • getName

      public String getName()
      name of the flag associated
      Returns:
      a string
    • getKeyName

      public String getKeyName()
      key name of the flag associated
      Returns:
      a string
    • isSuccess

      public boolean isSuccess()
      Returns true if the flag evaluation returned a good value, false if the default value returned
      Returns:
      Returns true if the flag evaluation returned a good value, false if the default value returned
    • jsonfy

      public String jsonfy()
      object converted to json string
      Returns:
      a json string
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object
    • toFlagState

      public FlagState<T> toFlagState()