Class FlagState<T>

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

public final class FlagState<T> extends BasicFlagState implements Serializable
The object provides a standard return responding the request of getting a flag value from a client sdk
See Also:
  • Method Details

    • of

      public static <T> FlagState<T> of(EvalDetail<T> data)
      build a good flag stat
      Type Parameters:
      T - String/Boolean/Numeric Type
      Parameters:
      data - a flag value with reason
      Returns:
      a FlagState
    • empty

      public static <T> FlagState<T> empty(String message)
      build a flag state without flag value
      Type Parameters:
      T - String/Boolean/Numeric Type
      Parameters:
      message - message the reason without flag value
      Returns:
      a FlagState
    • fromJson

      public static <T> FlagState<T> fromJson(String json, Class<T> cls)
      build a flag state from json
      Type Parameters:
      T - String/Boolean/Numeric Type
      Parameters:
      json - a string json
      cls - class to deserialize
      Returns:
      a FlagState
    • getData

      public EvalDetail<T> getData()
      return the flag value with all the details
      Returns:
      EvalDetail
    • toString

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object