org.rhq.core.pluginapi.util
Class ObjectUtil

java.lang.Object
  extended by org.rhq.core.pluginapi.util.ObjectUtil

public class ObjectUtil
extends Object


Constructor Summary
ObjectUtil()
           
 
Method Summary
static Object lookupAttributeProperty(Object value, String property)
           
static Object lookupDeepAttributeProperty(Object value, String propertyPath)
          Looks up deep object graph attributes using a dot delimited java bean spec style path.
static Double lookupDeepNumericAttributeProperty(Object value, String propertyPath)
          Reads a numeric value from a deep object graph as per ObjectUtil.lookupDeepAttributeProperty()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectUtil

public ObjectUtil()
Method Detail

lookupAttributeProperty

public static Object lookupAttributeProperty(Object value,
                                             String property)

lookupDeepNumericAttributeProperty

public static Double lookupDeepNumericAttributeProperty(Object value,
                                                        String propertyPath)
Reads a numeric value from a deep object graph as per ObjectUtil.lookupDeepAttributeProperty()

Parameters:
value - The object to look into
propertyPath - the property path to search
Returns:
the double value read from the object's property path or Double.NaN if it can't be read

lookupDeepAttributeProperty

public static Object lookupDeepAttributeProperty(Object value,
                                                 String propertyPath)
Looks up deep object graph attributes using a dot delimited java bean spec style path. So if I have an object A with a Member object B with a String value C I can refer to it as "b.c" and pass in the object A and I'll get back the value of a.getB().getC()

Parameters:
value - The object to look into
propertyPath - the property path to search
Returns:
the value read from the object's property path


Copyright © 2008 RHQ Project Advisory Board (Red Hat, Inc. and Hyperic, Inc.). All Rights Reserved.