Class MetricsHelper.AttributeResolver

java.lang.Object
com.zeroc.IceMX.MetricsHelper.AttributeResolver
Enclosing class:
MetricsHelper<T>

public static class MetricsHelper.AttributeResolver extends Object
Resolves attribute values from metrics objects.
  • Constructor Details

    • AttributeResolver

      protected AttributeResolver()
      Constructs an AttributeResolver.
  • Method Details

    • resolve

      public String resolve(MetricsHelper<?> helper, String attribute)
      Resolves an attribute value using the specified helper.
      Parameters:
      helper - the metrics helper
      attribute - the attribute name to resolve
      Returns:
      the resolved attribute value
      Throws:
      IllegalArgumentException - if the attribute is unknown
    • add

      public void add(String name, Method method)
      Adds an attribute resolver using a method.
      Parameters:
      name - the attribute name
      method - the method to invoke for resolution
    • add

      public void add(String name, Field field)
      Adds an attribute resolver using a field.
      Parameters:
      name - the attribute name
      field - the field to access for resolution
    • add

      public void add(String name, Method method, Field field)
      Adds an attribute resolver using a method and field combination.
      Parameters:
      name - the attribute name
      method - the method to invoke first
      field - the field to access on the method result
    • add

      public void add(String name, Method method, Method subMethod)
      Adds an attribute resolver using two chained methods.
      Parameters:
      name - the attribute name
      method - the first method to invoke
      subMethod - the second method to invoke on the first method's result