Class TypedResult<T>
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.rules.TypedResult<T>
-
- Direct Known Subclasses:
TypedCollectionResult
public class TypedResult<T> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static TypedResult<IItemQuery>
ITEM_QUERY
static ContentType<IItemQuery>
QUERY
static TypedResult<IQuantity>
SCORE
A constant to be used while transitioning the rules api from 1.0 to 2.0 to keep the old score values.
-
Constructor Summary
Constructors Constructor Description TypedResult(String identifier, String name, String description, ContentType<T> contentType)
TypedResult(String identifier, String name, String description, ContentType<T> contentType, Class<T> clazz)
Creates an object describing a singular typed result value with all needed information.TypedResult(String identifier, IAggregator<T,?> aggregator, ContentType<T> contentType, Class<T> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
format(Object result)
String
getDescription()
String
getIdentifier()
String
getName()
ContentType<T>
getPersister()
Get theContentType
for the result.Class<T>
getResultClass()
int
hashCode()
String
toString()
-
-
-
Field Detail
-
SCORE
public static final TypedResult<IQuantity> SCORE
A constant to be used while transitioning the rules api from 1.0 to 2.0 to keep the old score values.
-
QUERY
public static final ContentType<IItemQuery> QUERY
-
ITEM_QUERY
public static final TypedResult<IItemQuery> ITEM_QUERY
-
-
Constructor Detail
-
TypedResult
public TypedResult(String identifier, String name, String description, ContentType<T> contentType, Class<T> clazz)
Creates an object describing a singular typed result value with all needed information.- Parameters:
identifier
- result identifiername
- result namedescription
- a longer description of the resultcontentType
- a contentType that can parse and format valuesclazz
- the class of the typed result
-
TypedResult
public TypedResult(String identifier, String name, String description, ContentType<T> contentType)
-
TypedResult
public TypedResult(String identifier, IAggregator<T,?> aggregator, ContentType<T> contentType, Class<T> clazz)
-
-
Method Detail
-
getIdentifier
public String getIdentifier()
- Returns:
- result identifier
-
getName
public String getName()
- Returns:
- result name
-
getDescription
public String getDescription()
- Returns:
- result description
-
getPersister
public ContentType<T> getPersister()
Get theContentType
for the result.- Returns:
- value contentType
-
-