public class CountlyStore
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addConnection(java.lang.String str)
Adds a connection to the local store.
|
void |
addEvent(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> segmentation,
int timestamp,
int count,
double sum)
Adds a custom event to the local store.
|
java.lang.String[] |
connections()
Returns an unsorted array of the current stored connections.
|
java.lang.String[] |
events()
Returns an unsorted array of the current stored event JSON strings.
|
java.util.List<ly.count.android.api.Event> |
eventsList()
Returns a list of the current stored events, sorted by timestamp from oldest to newest.
|
java.lang.String |
getPreference(java.lang.String key)
Retrieves a preference from local store.
|
boolean |
isEmptyConnections()
Returns true if no connections are current stored, false otherwise.
|
void |
removeConnection(java.lang.String str)
Removes a connection from the local store.
|
void |
removeEvents(java.util.Collection<ly.count.android.api.Event> eventsToRemove)
Removes the specified events from the local store.
|
void |
setPreference(java.lang.String key,
java.lang.String value)
Adds a preference to local store.
|
public java.lang.String[] connections()
public java.lang.String[] events()
public java.util.List<ly.count.android.api.Event> eventsList()
public boolean isEmptyConnections()
public void addConnection(java.lang.String str)
str
- the connection to be added, ignored if null or emptypublic void removeConnection(java.lang.String str)
str
- the connection to be removed, ignored if null or empty,
or if a matching connection cannot be foundpublic void addEvent(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> segmentation, int timestamp, int count, double sum)
key
- name of the custom event, required, must not be the empty stringsegmentation
- segmentation values for the custom event, may be nulltimestamp
- timestamp (seconds since 1970) in GMT when the event occurredcount
- count associated with the custom event, should be more than zerosum
- sum associated with the custom event, if not used, pass zero.
NaN and infinity values will be quietly ignored.public void removeEvents(java.util.Collection<ly.count.android.api.Event> eventsToRemove)
eventsToRemove
- collection containing the events to remove from the local storepublic java.lang.String getPreference(java.lang.String key)
key
- the preference keypublic void setPreference(java.lang.String key, java.lang.String value)
key
- the preference keyvalue
- the preference value, supply null value to remove preference