Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/sdk/server-side-sdks/java/java-openfeature.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ String stringValue = openFeatureClient.getStringValue("string-flag", "default",
// Retrieve an integer flag value
Integer intValue = openFeatureClient.getIntegerValue("integer-flag", 0, context);

// Retrieve a long flag value
Long longValue = openFeatureClient.getLongValue("long-flag", 0L, context);

// Retrieve a double flag value
Double doubleValue = openFeatureClient.getDoubleValue("double-flag", 0.0, context);

Expand All @@ -124,6 +127,15 @@ if (boolValue) {

**NOTE: use `DevCycleCloudClient` \ `DevCycleCloudOptions` for Cloud Bucketing mode.**

### Long Values

DevCycle numeric values are represented as doubles by the Java OpenFeature provider. When using
`getLongValue()`, the value must be an integral number within the double safe-integer range:
`-(2^53 - 1)` through `2^53 - 1` (`-9_007_199_254_740_991` through `9_007_199_254_740_991`).

Fractional values and values outside this range return the supplied default value with a
`TYPE_MISMATCH` error. Use `getDoubleValue()` when fractional values are required.

### Required Targeting Key

The DevCycle provider requires either a `targetingKey` or `user_id` to be set on the OpenFeature context.
Expand Down
Loading