Package co.featbit.commons.model
Class EvalDetail<T>
java.lang.Object
co.featbit.commons.model.EvalDetail<T>
- Type Parameters:
T- - String/Boolean/Numeric Type
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptionbooleanstatic <T> EvalDetail<T>build the method from a json string, this method is only for internal usegetId()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 usekey name of the flag associatedgetName()name of the flag associatedget the reason that evaluate the flag value.return a feature flag evaluation valueinthashCode()booleanReturns true if the flag evaluation returned a good value, false if the default value returnedjsonfy()object converted to json stringstatic <T> EvalDetail<T>build method, this method is only for internal usetoString()
-
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
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
return a feature flag evaluation value- Returns:
- the flag value
-
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
get the reason that evaluate the flag value.- Returns:
- a string
-
getName
name of the flag associated- Returns:
- a 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
object converted to json string- Returns:
- a json string
-
equals
-
hashCode
public int hashCode() -
toString
-
toFlagState
-