Package com.vaadin.base.devserver.stats
Class StatisticsContainer
java.lang.Object
com.vaadin.base.devserver.stats.StatisticsContainer
Wraps a JSON data structure and provides a slightly easier API for it.
-
Constructor Summary
ConstructorsConstructorDescriptionStatisticsContainer(tools.jackson.databind.node.ObjectNode json) Wraps the given json with this API. -
Method Summary
Modifier and TypeMethodDescriptionvoidSets the value to the given field and updates related aggregate fields.Returns the given field value as a string.doublegetValueAsDouble(String name) Returns the given field value as a double.voidIncrements the value for the given field.voidStores a long using the given field name.voidStores a string using the given field name.voidStores a JSON object using the given field name.
-
Constructor Details
-
StatisticsContainer
public StatisticsContainer(tools.jackson.databind.node.ObjectNode json) Wraps the given json with this API.- Parameters:
json- the json to wrap
-
-
Method Details
-
setValue
Stores a string using the given field name.- Parameters:
name- name of the field to storevalue- the value to store
-
setValue
Stores a long using the given field name.- Parameters:
name- name of the field to storevalue- the value to store
-
setValue
Stores a JSON object using the given field name.- Parameters:
name- name of the field to storevalue- the value to store
-
increment
Increments the value for the given field.- Parameters:
name- the name of the field to increment
-
aggregate
Sets the value to the given field and updates related aggregate fields.Updates the following fields:
nameThe new valuename_minThe minimum valuename_maxThe maximum valuename_countNumber of values collected
- Parameters:
name- Name of the field to update.newValue- The new value to store.
-
getValue
Returns the given field value as a string.- Parameters:
name- name of the field to get- Returns:
- the value of the field as a string
-
getValueAsDouble
Returns the given field value as a double.- Parameters:
name- name of the field to get- Returns:
- the value of the field as a double, 0 if missing or not a double
-