public class StatisticsContainer extends Object
| Constructor and Description |
|---|
StatisticsContainer(com.fasterxml.jackson.databind.node.ObjectNode json)
Wraps the given json with this API.
|
| Modifier and Type | Method and Description |
|---|---|
void |
aggregate(String name,
double newValue)
Sets the value to the given field and updates related aggregate fields.
|
String |
getValue(String name)
Returns the given field value as a string.
|
double |
getValueAsDouble(String name)
Returns the given field value as a double.
|
void |
increment(String name)
Increments the value for the given field.
|
void |
setValue(String name,
com.fasterxml.jackson.databind.JsonNode value)
Stores a JSON object using the given field name.
|
void |
setValue(String name,
long value)
Stores a long using the given field name.
|
void |
setValue(String name,
String value)
Stores a string using the given field name.
|
public StatisticsContainer(com.fasterxml.jackson.databind.node.ObjectNode json)
json - the json to wrappublic void setValue(String name, String value)
name - name of the field to storevalue - the value to storepublic void setValue(String name, long value)
name - name of the field to storevalue - the value to storepublic void setValue(String name, com.fasterxml.jackson.databind.JsonNode value)
name - name of the field to storevalue - the value to storepublic void increment(String name)
name - the name of the field to incrementpublic void aggregate(String name, double newValue)
Updates the following fields:
name The new valuename_min The minimum valuename_max The maximum valuename_count Number of values collectedname - Name of the field to update.newValue - The new value to store.public String getValue(String name)
name - name of the field to getpublic double getValueAsDouble(String name)
name - name of the field to getCopyright © 2000–2022 Vaadin Ltd. All rights reserved.