public class

ApptimizeVar

extends Object
java.lang.Object
   ↳ com.apptimize.ApptimizeVar<T>

Class Overview

An Apptimize variable whose value can be changed in A/B experiments.

We can create them using the create factory methods (e.g., createString(String, String), createMapOfDoubles(String, java.util.Map)).

We can get the value of an Apptimize variable using value(). This value will vary depending on what A/B experiment variants this device is currently enrolled in.

Summary

Public Methods
static ApptimizeVar<Boolean> createBoolean(String name, Boolean defaultValue)
Creates an ApptimizeVar with a Boolean value.
static ApptimizeVar<Double> createDouble(String name, Double defaultValue)
Creates an ApptimizeVar with a Double value.
static ApptimizeVar<Integer> createInteger(String name, Integer defaultValue)
Creates an ApptimizeVar with an Integer value.
static ApptimizeVar<List<Boolean>> createListOfBooleans(String name, List<Boolean> defaultValue)

Creates an ApptimizeVar with a List<Boolean> value.

static ApptimizeVar<List<Double>> createListOfDoubles(String name, List<Double> defaultValue)

Creates an ApptimizeVar with a List<Double> value.

static ApptimizeVar<List<Integer>> createListOfIntegers(String name, List<Integer> defaultValue)

Creates an ApptimizeVar with a List<Integer> value.

static ApptimizeVar<List<String>> createListOfStrings(String name, List<String> defaultValue)

Creates an ApptimizeVar with a List<String> value.

static ApptimizeVar<Map<String, Boolean>> createMapOfBooleans(String name, Map<String, Boolean> defaultValue)

Creates an ApptimizeVar with a Map<String, Boolean> value.

static ApptimizeVar<Map<String, Double>> createMapOfDoubles(String name, Map<String, Double> defaultValue)

Creates an ApptimizeVar with a Map<String, Double> value.

static ApptimizeVar<Map<String, Integer>> createMapOfIntegers(String name, Map<String, Integer> defaultValue)

Creates an ApptimizeVar with a Map<String, Integer> value.

static ApptimizeVar<Map<String, String>> createMapOfStrings(String name, Map<String, String> defaultValue)

Creates an ApptimizeVar with a Map<String, String> value.

static ApptimizeVar<String> createString(String name, String defaultValue)
Creates an ApptimizeVar with a String value.
boolean equals(Object o)
int hashCode()
T value()
Gets the current value of this ApptimizeVar.
T value(ApptimizeOptions options)
Gets the current value of this ApptimizeVar.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static ApptimizeVar<Boolean> createBoolean (String name, Boolean defaultValue)

Creates an ApptimizeVar with a Boolean value.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<Boolean>.
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<Double> createDouble (String name, Double defaultValue)

Creates an ApptimizeVar with a Double value.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<Double>.
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<Integer> createInteger (String name, Integer defaultValue)

Creates an ApptimizeVar with an Integer value.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<Integer>.
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<List<Boolean>> createListOfBooleans (String name, List<Boolean> defaultValue)

Creates an ApptimizeVar with a List<Boolean> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<List<Boolean>>.
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<List<Double>> createListOfDoubles (String name, List<Double> defaultValue)

Creates an ApptimizeVar with a List<Double> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<List<Double>>.
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<List<Integer>> createListOfIntegers (String name, List<Integer> defaultValue)

Creates an ApptimizeVar with a List<Integer> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<List<Integer>>.
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<List<String>> createListOfStrings (String name, List<String> defaultValue)

Creates an ApptimizeVar with a List<String> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<List<String>>.
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<Map<String, Boolean>> createMapOfBooleans (String name, Map<String, Boolean> defaultValue)

Creates an ApptimizeVar with a Map<String, Boolean> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<Map<String, Boolean>> .
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<Map<String, Double>> createMapOfDoubles (String name, Map<String, Double> defaultValue)

Creates an ApptimizeVar with a Map<String, Double> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<Map<String, Double>> .
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<Map<String, Integer>> createMapOfIntegers (String name, Map<String, Integer> defaultValue)

Creates an ApptimizeVar with a Map<String, Integer> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<Map<String, Integer>> .
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<Map<String, String>> createMapOfStrings (String name, Map<String, String> defaultValue)

Creates an ApptimizeVar with a Map<String, String> value.

Note that when the ApptimizeVar is created, its default value will be set to a copy of the input defaultValue rather than to the original object. Any subsequent changes to the original input object will not modify the default value of the returned ApptimizeVar.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<Map<String, String>> .
Throws
NullPointerException If the specified name is null.

public static ApptimizeVar<String> createString (String name, String defaultValue)

Creates an ApptimizeVar with a String value.

Parameters
name The name of this ApptimizeVar, as it will appear when configuring A/B experiments at https://apptimize.com/admin/
defaultValue The value of this ApptimizeVar if this device is not enrolled in any A/B experiments that affect this variable.
Returns
  • The created ApptimizeVar<String>.
Throws
NullPointerException If the specified name is null.

public boolean equals (Object o)

public int hashCode ()

public T value ()

Gets the current value of this ApptimizeVar. This value will vary depending on what A/B experiment variants this device is currently enrolled in. If this device is not enrolled in any A/B experiments that affect this ApptimizeVar, this method will return the default value of this ApptimizeVar. Note that even if you call this method and perform modifications on the returned value, subsequent calls to this method will still return new objects without these modifications.

Returns
  • The current value of this ApptimizeVar for this device.

public T value (ApptimizeOptions options)

Gets the current value of this ApptimizeVar. This value will vary depending on what A/B experiment variants this device is currently enrolled in. If this device is not enrolled in any A/B experiments that affect this ApptimizeVar, this method will return the default value of this ApptimizeVar. Note that if you call this method and perform modifications on the returned value, subsequent calls to this method will return new objects without these modifications. Options can be configured using the input ApptimizeOptions.

Parameters
options Options for configuring this method. See ApptimizeOptions
Returns
  • The current value of this ApptimizeVar for this device.