Class SessionRequestCounts
java.lang.Object
io.goobi.viewer.model.statistics.usage.SessionRequestCounts
Class holding counts of requests of different
RequestTypes. Should be serialized to a string to dao storage- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructor.SessionRequestCounts(String data) Constructor to deserialize data from a string. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo SessionRequestCounts are equal if the have the same request counts for allRequestTypes.getCount(RequestType type) Get the total count of requests for a givenRequestType.inthashCode()voidincrementCount(RequestType type) Increment the total count of requests for a givenRequestTypeby one.voidsetCount(RequestType type, long count) Set the total count of requests for a givenRequestType.Turn into a json representation.
-
Constructor Details
-
SessionRequestCounts
public SessionRequestCounts()Empty default constructor. -
SessionRequestCounts
Constructor to deserialize data from a string.- Parameters:
data- JSON array string with serialized request counts
-
-
Method Details
-
setCount
Set the total count of requests for a givenRequestType.- Parameters:
type- the request type to set the count forcount- the number of requests to set
-
incrementCount
Increment the total count of requests for a givenRequestTypeby one.- Parameters:
type- the request type whose count to increment
-
getCount
Get the total count of requests for a givenRequestType.- Parameters:
type- the request type to retrieve the count for- Returns:
Long
-
toJsonArray
Turn into a json representation.- Returns:
- a json String
-
hashCode
public int hashCode() -
equals
Two SessionRequestCounts are equal if the have the same request counts for allRequestTypes.
-