website logo
โŒ˜K
Floodgate Documentation Portal
๐Ÿš€GETTING STARTED
Quick Start Tutorial
Basic Concepts
๐ŸšฉMANAGING FLAGS
Feature Flag Dashboard
Creating a Feature Flag
Environment Flag Dashboard
Environment Flag Settings
Feature Flag Kill Switch
Updating a Feature Flag
Deleting a Feature Flag
๐Ÿ–ฅ๏ธAPPLICATIONS
About Applications
Creating New Applications
Switching Applications
โ›…ENVIRONMENTS
About Environments
Creating New Environments
๐Ÿ’—MANAGING YOUR TEAM
Team Members Dashboard
Managing Team Member Permissions
Inviting Team Members
โš™๏ธADMINISTRATION
Managing Subscriptions
Usage
๐Ÿ”ŒINTEGRATIONS
Microsoft Teams
Slack
๐Ÿ› ๏ธDEVELOPMENT
The User Object
โœ”๏ธSDKs
Floodgate SDK Overview
.NET SDK Documentation
Java SDK Documentation
PHP SDK Documentation
Node.js SDK Documentation
JavaScript SDK Documentation
Docs powered byย archbeeย 
9min

Java SDK Documentation

The guide will walk you through the installation and usage of the Floodgate Java SDK.

Requirements

The Floodgate Java SDK is currently compatible with JDK 11+

Getting Started

The first step is to install the Floodgate SDK as a dependency in your application using your application's dependency manager.

Maven

Java
|

Gradle

Java
|

Add Required Imports

Java
|

Now you have the Floodgate SDK installed and imported you can create a new instance of the Floodgate Client.

Java
|

Evaluating a Flag

Using the client object you can now evaluate a flag using the getValue method. The getValue method requires two parameters with an optional third.

Property

Required

Description

Key

Yes

This is the Flag Key which you entered when creating the flag.

Default Value

Yes

This is the value which you want the flag to evaluate to if no flag data can be found.

User Object

No

This is an optional value which can be passed containing information about the user. This information is required to evaluate flags when doing user targeting or percentage rollout releases.

The example below shows an evaluation of a flag called my-feature-flag passing in a default value of false.

Java
|

View the Code

All our SDKs are open source and you are free to check out what's going on inside them. In fact we encourage contributions from the Floodgate community. You can view the source code on GitHub.

Updated 11 Feb 2021
Did this page help you?
Yes
No
UP NEXT
PHP SDK Documentation
Docs powered byย archbeeย 
TABLE OF CONTENTS
Getting Started
Maven
Gradle
Add Required Imports
Evaluating a Flag
View the Code