java.lang.Object
com.zeroc.IceMX.MetricsHelper.AttributeResolver
- Enclosing class:
- MetricsHelper<T>
Resolves attribute values from metrics objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an attribute resolver using a field.void
Adds an attribute resolver using a method.void
Adds an attribute resolver using a method and field combination.void
Adds an attribute resolver using two chained methods.resolve
(MetricsHelper<?> helper, String attribute) Resolves an attribute value using the specified helper.
-
Constructor Details
-
AttributeResolver
protected AttributeResolver()Constructs an AttributeResolver.
-
-
Method Details
-
resolve
Resolves an attribute value using the specified helper.- Parameters:
helper
- the metrics helperattribute
- the attribute name to resolve- Returns:
- the resolved attribute value
- Throws:
IllegalArgumentException
- if the attribute is unknown
-
add
Adds an attribute resolver using a method.- Parameters:
name
- the attribute namemethod
- the method to invoke for resolution
-
add
Adds an attribute resolver using a field.- Parameters:
name
- the attribute namefield
- the field to access for resolution
-
add
Adds an attribute resolver using a method and field combination.- Parameters:
name
- the attribute namemethod
- the method to invoke firstfield
- the field to access on the method result
-
add
Adds an attribute resolver using two chained methods.- Parameters:
name
- the attribute namemethod
- the first method to invokesubMethod
- the second method to invoke on the first method's result
-