com.vaadin.base.devserver.stats.
Class StatisticsContainer
Wraps a JSON data structure and provides a slightly easier API for it.
-
Constructor Summary
ConstructorsConstructorDescriptionStatisticsContainer
(com.fasterxml.jackson.databind.node.ObjectNode json) Wraps the given json with this API.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the value to the given field and updates related aggregate fields.
Returns the given field value as a string.
double
getValueAsDouble
(String name) Returns the given field value as a double.
void
Increments the value for the given field.
void
Stores a long using the given field name.
void
Stores a JSON object using the given field name.
void
Stores a string using the given field name.
-
Constructor Details
-
StatisticsContainer
public StatisticsContainer(com.fasterxml.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:
name
The new valuename_min
The minimum valuename_max
The maximum valuename_count
Number 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 getReturns:
the value of the field as a string
-
getValueAsDouble
Returns the given field value as a double.
Parameters:
name
- name of the field to getReturns:
the value of the field as a double, 0 if missing or not a double
-