PlayerIO

The fastest way to build online games without breaking a sweat.

Android Client Reference

Android  class documentationClass BuyItemInfo

Namespace: com.playerio
Language: Java

Represents information about the purchase of a PayVault item.

The minimum information necessary to create an instance of this class is an itemKey representing the PayVaultItem that should be purchased.

It is also possible to add a custom payload, and this data will always be present when reading the item from the user's Vault. For example: Imagine that we have a racing game and users should be able to buy different cars of different colors, but that color doesn't affect the price of the car. Instead of creating one PayVaultItem for each combination of type and color, we need only create one item for each type and give them a different price, and color can then be added in the payload when buying a car.

Setting the payload works exactly like manipulating a DatabaseObject from BigDB.

Methods

 
public
BuyItemInfo (String itemKey)

Creates a new BuyItemInfo to describe an item to purchase.

public void
clear ()

Removes all properties on this object

public boolean
contains (String propertyExpression)

Returns true if the given property exists on this object

public DatabaseArray
getArray (String propertyExpression)

Get the given DatabaseArray property

public boolean
getBool (String propertyExpression, boolean defaultValue)

Get the given boolean property, or the default if it doesn't exist.

public boolean
getBool (String propertyExpression)

Get the given boolean property

public byte[]
getBytes (String propertyExpression)

Get the given byte array property

public byte[]
getBytes (String propertyExpression, byte[] defaultValue)

Get the given byte array property, or the default if it doesn't exist.

public Date
getDateTime (String propertyExpression, Date defaultValue)

Get the given Date property, or the default if it doesn't exist.

public Date
getDateTime (String propertyExpression)

Get the given Date property

public double
getDouble (String propertyExpression, double defaultValue)

Get the given double property, or the default if it doesn't exist.

public double
getDouble (String propertyExpression)

Get the given double property

public float
getFloat (String propertyExpression, float defaultValue)

Get the given float property, or the default if it doesn't exist.

public float
getFloat (String propertyExpression)

Get the given float property

public int
getInt (String propertyExpression)

Get the given int property

public int
getInt (String propertyExpression, int defaultValue)

Get the given int property, or the default if it doesn't exist.

public long
getLong (String propertyExpression, long defaultValue)

Get the given long property, or the default if it doesn't exist.

public long
getLong (String propertyExpression)

Get the given long property

public DatabaseObject
getObject (String propertyExpression)

Get the given DatabaseObject property

public String
getString (String propertyExpression)

Get the given String property

public String
getString (String propertyExpression, String defaultValue)

Get the given String property, or the default if it doesn't exist.

public int
getUInt (String propertyExpression, int defaultValue)

Get the given uint property, or the default if it doesn't exist.

public int
getUInt (String propertyExpression)

Get the given uint property

public Object
getValue (String propertyExpression)

Get the given property as an object

public ArrayList<String>
properties ()

Get the names of all properties on this object

public BuyItemInfo
remove (String propertyExpression)

Removes the given property from this object

public BuyItemInfo
set (String propertyExpression, byte[] value)

Set the given property to the given bye array value

public BuyItemInfo
set (String propertyExpression, double value)

Set the given property to the given double value

public BuyItemInfo
set (String propertyExpression, float value)

Set the given property to the given float value

public BuyItemInfo
set (String propertyExpression, DatabaseArray value)

Set the given property to the given DatabaseArray value

public BuyItemInfo
set (String propertyExpression, DatabaseObject value)

Set the given property to the given DatabaseObject value

public BuyItemInfo
set (String propertyExpression, Date value)

Set the given property to the given Date value

public BuyItemInfo
set (String propertyExpression, String value)

Set the given property to the given string value

public BuyItemInfo
set (String propertyExpression, int value)

Set the given property to the given int value

public BuyItemInfo
set (String propertyExpression, boolean value)

Set the given property to the given boolean value

public BuyItemInfo
set (String propertyExpression, long value)

Set the given property to the given long value

public BuyItemInfo
setUInt (String propertyExpression, int value)

Set the given property to the given uint value

public int
size ()

Returns the number of properties on this object

BuyItemInfo.BuyItemInfo

public
BuyItemInfo (String itemKey)

Creates a new BuyItemInfo to describe an item to purchase.

Arguments

String itemKey
The key of the underlying item in the PayVaultItems table.

BuyItemInfo.clear

public void
clear ()

Removes all properties on this object

BuyItemInfo.contains

public boolean
contains (String propertyExpression)

Returns true if the given property exists on this object

Arguments

String propertyExpression

BuyItemInfo.getArray

public DatabaseArray
getArray (String propertyExpression)

Get the given DatabaseArray property

Arguments

String propertyExpression

BuyItemInfo.getBool

public boolean
getBool (String propertyExpression, boolean defaultValue)

Get the given boolean property, or the default if it doesn't exist.

Arguments

String propertyExpression
boolean defaultValue

BuyItemInfo.getBool

public boolean
getBool (String propertyExpression)

Get the given boolean property

Arguments

String propertyExpression

BuyItemInfo.getBytes

public byte[]
getBytes (String propertyExpression)

Get the given byte array property

Arguments

String propertyExpression

BuyItemInfo.getBytes

public byte[]
getBytes (String propertyExpression, byte[] defaultValue)

Get the given byte array property, or the default if it doesn't exist.

Arguments

String propertyExpression
byte[] defaultValue

BuyItemInfo.getDateTime

public Date
getDateTime (String propertyExpression, Date defaultValue)

Get the given Date property, or the default if it doesn't exist.

Arguments

String propertyExpression
Date defaultValue

BuyItemInfo.getDateTime

public Date
getDateTime (String propertyExpression)

Get the given Date property

Arguments

String propertyExpression

BuyItemInfo.getDouble

public double
getDouble (String propertyExpression, double defaultValue)

Get the given double property, or the default if it doesn't exist.

Arguments

String propertyExpression
double defaultValue

BuyItemInfo.getDouble

public double
getDouble (String propertyExpression)

Get the given double property

Arguments

String propertyExpression

BuyItemInfo.getFloat

public float
getFloat (String propertyExpression, float defaultValue)

Get the given float property, or the default if it doesn't exist.

Arguments

String propertyExpression
float defaultValue

BuyItemInfo.getFloat

public float
getFloat (String propertyExpression)

Get the given float property

Arguments

String propertyExpression

BuyItemInfo.getInt

public int
getInt (String propertyExpression)

Get the given int property

Arguments

String propertyExpression

BuyItemInfo.getInt

public int
getInt (String propertyExpression, int defaultValue)

Get the given int property, or the default if it doesn't exist.

Arguments

String propertyExpression
int defaultValue

BuyItemInfo.getLong

public long
getLong (String propertyExpression, long defaultValue)

Get the given long property, or the default if it doesn't exist.

Arguments

String propertyExpression
long defaultValue

BuyItemInfo.getLong

public long
getLong (String propertyExpression)

Get the given long property

Arguments

String propertyExpression

BuyItemInfo.getObject

public DatabaseObject
getObject (String propertyExpression)

Get the given DatabaseObject property

Arguments

String propertyExpression

BuyItemInfo.getString

public String
getString (String propertyExpression)

Get the given String property

Arguments

String propertyExpression

BuyItemInfo.getString

public String
getString (String propertyExpression, String defaultValue)

Get the given String property, or the default if it doesn't exist.

Arguments

String propertyExpression
String defaultValue

BuyItemInfo.getUInt

public int
getUInt (String propertyExpression, int defaultValue)

Get the given uint property, or the default if it doesn't exist.

Arguments

String propertyExpression
int defaultValue

BuyItemInfo.getUInt

public int
getUInt (String propertyExpression)

Get the given uint property

Arguments

String propertyExpression

BuyItemInfo.getValue

public Object
getValue (String propertyExpression)

Get the given property as an object

Arguments

String propertyExpression

BuyItemInfo.properties

public ArrayList<String>
properties ()

Get the names of all properties on this object

BuyItemInfo.remove

public BuyItemInfo
remove (String propertyExpression)

Removes the given property from this object

Arguments

String propertyExpression

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, byte[] value)

Set the given property to the given bye array value

Arguments

String propertyExpression
byte[] value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, double value)

Set the given property to the given double value

Arguments

String propertyExpression
double value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, float value)

Set the given property to the given float value

Arguments

String propertyExpression
float value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, DatabaseArray value)

Set the given property to the given DatabaseArray value

Arguments

String propertyExpression
DatabaseArray value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, DatabaseObject value)

Set the given property to the given DatabaseObject value

Arguments

String propertyExpression
DatabaseObject value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, Date value)

Set the given property to the given Date value

Arguments

String propertyExpression
Date value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, String value)

Set the given property to the given string value

Arguments

String propertyExpression
String value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, int value)

Set the given property to the given int value

Arguments

String propertyExpression
int value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, boolean value)

Set the given property to the given boolean value

Arguments

String propertyExpression
boolean value

BuyItemInfo.set

public BuyItemInfo
set (String propertyExpression, long value)

Set the given property to the given long value

Arguments

String propertyExpression
long value

BuyItemInfo.setUInt

public BuyItemInfo
setUInt (String propertyExpression, int value)

Set the given property to the given uint value

Arguments

String propertyExpression
int value

BuyItemInfo.size

public int
size ()

Returns the number of properties on this object