forked from open-feature/java-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseEvaluation.java
44 lines (39 loc) · 1.01 KB
/
BaseEvaluation.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package dev.openfeature.sdk;
/**
* This is a common interface between the evaluation results that providers return and what is given to the end users.
*
* @param <T> The type of flag being evaluated.
*/
public interface BaseEvaluation<T> {
/**
* Returns the resolved value of the evaluation.
*
* @return {T} the resolve value
*/
T getValue();
/**
* Returns an identifier for this value, if applicable.
*
* @return {String} value identifier
*/
String getVariant();
/**
* Describes how we came to the value that we're returning.
*
* @return {Reason}
*/
String getReason();
/**
* The error code, if applicable. Should only be set when the Reason is ERROR.
*
* @return {ErrorCode}
*/
ErrorCode getErrorCode();
/**
* The error message (usually from exception.getMessage()), if applicable.
* Should only be set when the Reason is ERROR.
*
* @return {String}
*/
String getErrorMessage();
}