public class FlagsmithClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FlagsmithClient.Builder |
| Modifier and Type | Method and Description |
|---|---|
FlagsmithCache |
getCache()
Returns a FlagsmithCache cache object that encapsulates methods to manipulate the cache.
|
Flags |
getEnvironmentFlags()
Get all the default for flags for the current environment.
|
Flags |
getIdentityFlags(String identifier)
Get all the flags for the current environment for a given identity.
|
Flags |
getIdentityFlags(String identifier,
Map<String,Object> traits)
Get all the flags for the current environment for a given identity.
|
List<Segment> |
getIdentitySegments(String identifier)
Get a list of segments that the given identity is in.
|
List<Segment> |
getIdentitySegments(String identifier,
Map<String,Object> traits)
Get a list of segments that the given identity is in.
|
static FlagsmithClient.Builder |
newBuilder() |
void |
updateEnvironment()
Load the environment flags in the environment variable from the API.
|
public static FlagsmithClient.Builder newBuilder()
public void updateEnvironment()
public Flags getEnvironmentFlags() throws FlagsmithApiError
FlagsmithApiError - if error communicating with Flagsmith APIpublic Flags getIdentityFlags(String identifier) throws FlagsmithClientError
identifier - identifier stringFlagsmithClientError - if error when retrieving flags for identitypublic Flags getIdentityFlags(String identifier, Map<String,Object> traits) throws FlagsmithClientError
identifier - identifier stringtraits - list of key value traitsFlagsmithClientError - if error when retrieving flags for identitypublic List<Segment> getIdentitySegments(String identifier) throws FlagsmithClientError
identifier - a unique identifier for the identity in the current
environment, e.g. email address, username, uuidFlagsmithClientError - if error when retrieving segments for identitypublic List<Segment> getIdentitySegments(String identifier, Map<String,Object> traits) throws FlagsmithClientError
identifier - a unique identifier for the identity in the current
environment, e.g. email address, username, uuidtraits - a dictionary of traits to add / update on the identity in
Flagsmith, e.g. {"num_orders": 10}FlagsmithClientError - if error when retrieving segments for identitypublic FlagsmithCache getCache()
Copyright © 2022. All rights reserved.