public class FeatureToggles extends Object
static final fields of the class the toggle controls.
All methods in this class returns the default value if the system property has not been assigned, or if the value of
the system property cannot be interpreted as a value of the expected type.
For features that the user is ever expected to touch, feature toggles is the wrong abstraction!| Modifier and Type | Method and Description |
|---|---|
static boolean |
flag(Class<?> location,
String name,
boolean defaultValue)
Get the value of a
boolean system property. |
static <E extends Enum<E>> |
flag(Class<?> location,
String name,
E defaultValue)
Get the value of a
enum system property. |
static int |
getInteger(Class<?> location,
String name,
int defaultValue)
Get the value of a
int system property. |
static long |
getLong(Class<?> location,
String name,
long defaultValue)
Get the value of a
long system property. |
static boolean |
packageFlag(Class<?> location,
String name,
boolean defaultValue)
Get the value of a
boolean system property. |
static String |
toggle(Class<?> location,
String name,
boolean value)
Helps creating a JVM parameter for setting a
boolean feature toggle. |
static String |
toggle(Class<?> location,
String name,
Enum<?> value)
Helps creating a JVM parameter for setting an
enum feature toggle. |
static String |
toggle(Class<?> location,
String name,
long value)
Helps creating a JVM parameter for setting a
long or int feature toggle. |
public static boolean flag(Class<?> location, String name, boolean defaultValue)
boolean system property.
The absolute name of the system property is computed based on the provided class and local name.location - the class that owns the flag.name - the local name of the flag.defaultValue - the default value of the flag if the system property is not assigned.public static boolean packageFlag(Class<?> location, String name, boolean defaultValue)
boolean system property.
The absolute name of the system property is computed based on the package of the provided class and local name.location - a class in the package that owns the flag.name - the local name of the flag.defaultValue - the default value of the flag if the system property is not assigned.public static long getLong(Class<?> location, String name, long defaultValue)
long system property.
The absolute name of the system property is computed based on the provided class and local name.location - the class that owns the flag.name - the local name of the flag.defaultValue - the default value of the flag if the system property is not assigned.public static int getInteger(Class<?> location, String name, int defaultValue)
int system property.
The absolute name of the system property is computed based on the provided class and local name.location - the class that owns the flag.name - the local name of the flag.defaultValue - the default value of the flag if the system property is not assigned.public static <E extends Enum<E>> E flag(Class<?> location, String name, E defaultValue)
enum system property.
The absolute name of the system property is computed based on the provided class and local name.E - the enum value type.location - the class that owns the flag.name - the local name of the flag.defaultValue - the default value of the flag if the system property is not assigned.public static String toggle(Class<?> location, String name, boolean value)
boolean feature toggle.location - the class that owns the flag.name - the local name of the flag.value - the value to assign to the feature toggle.public static String toggle(Class<?> location, String name, long value)
long or int feature toggle.location - the class that owns the flag.name - the local name of the flag.value - the value to assign to the feature toggle.public static String toggle(Class<?> location, String name, Enum<?> value)
enum feature toggle.location - the class that owns the flag.name - the local name of the flag.value - the value to assign to the feature toggle.Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.