public final class Builder extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Builder() |
|
Builder(Builder other)
Constructs a new Builder with the same mappings and metadata as the specified Builder.
|
|
Builder(LibHoney libhoney) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Map<String,Object> fields)
Copies all of the field mappings from the specified map to this Builder.
|
void |
addDynField(String key,
Callable function)
Associates the specified function with the specified key in the dynamic fields map.
|
void |
addDynFields(Map<String,Callable> dynFields)
Copies all of the dynamic field mappings from the specified map to this Builder.
|
void |
addField(String key,
Object value)
Associates the specified value with the specified key in the fields map.
|
void |
addFromBuilder(Builder other)
Copies all of the field and dynamic field mappings from the specified Builder to this Builder.
|
boolean |
equals(Object obj)
Compares the specified object with this Builder for equality.
|
String |
getDataSet()
Returns the data set identifier for this Builder.
|
Map<String,Callable> |
getDynFields()
Returns dynamic fields for this Builder.
|
Map<String,Object> |
getFields()
Returns fields for this Builder.
|
LibHoney |
getLibHoney()
Returns a reference to LibHoney.
|
int |
getSampleRate()
Returns the sample rate for this Builder.
|
String |
getWriteKey()
Returns the write key for this Builder.
|
int |
hashCode()
Returns the hash code value for this Builder.
|
boolean |
isEmpty()
Returns true if this Builder contains no fields.
|
protected void |
linkLibHoney(LibHoney libhoney)
Stores a reference to LibHoney and applies LibHoney's metadata to this Builder.
|
Event |
newEvent()
Creates a Event from this Builder's fields.
|
void |
send()
Creates an Event, then sends with Transmission as a request, or as a dropped response if it should be dropped.
|
void |
sendNow(Map<String,Object> fields)
Immediately send a map of keys and values as a Event
|
void |
setDataSet(String dataSet)
Sets the data set
|
void |
setSampleRate(int sampleRate)
Sets the sample rate
|
void |
setWriteKey(String writeKey)
Sets the write key
|
org.json.JSONObject |
toJson()
Returns a JSON representation of this Builder.
|
String |
toString()
Returns a string representation of this Builder.
|
protected Builder()
public Builder(LibHoney libhoney)
public Builder(Builder other)
other - the Builder whose mappings are to be stored in this mappublic void add(Map<String,Object> fields)
fields - field mappings to be added to this Builderpublic void addDynField(String key, Callable function)
key - key with which the specified function is to be associatedfunction - function to be associated with the specified keypublic void addDynFields(Map<String,Callable> dynFields)
dynFields - dynamic field mappings to be added this Builderpublic void addField(String key, Object value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic void addFromBuilder(Builder other)
other - the Builder whose mappings are to be added to this mappublic boolean equals(Object obj)
public String getDataSet()
public Map<String,Callable> getDynFields()
public Map<String,Object> getFields()
public LibHoney getLibHoney()
public int getSampleRate()
public String getWriteKey()
public int hashCode()
public boolean isEmpty()
protected void linkLibHoney(LibHoney libhoney)
libhoney - reference to LibHoneypublic Event newEvent()
public void send()
throws HoneyException
HoneyException - if there is something wrong with the requestpublic void sendNow(Map<String,Object> fields) throws HoneyException
fields - field keyHoneyException - if there is something wrong with the requestpublic void setDataSet(String dataSet)
dataSet - data setpublic void setSampleRate(int sampleRate)
sampleRate - sample ratepublic void setWriteKey(String writeKey)
writeKey - write keypublic org.json.JSONObject toJson()
Copyright © 2017. All rights reserved.