org.apache.commons.attributes
Class AttributeUtil
java.lang.Object
|
+--org.apache.commons.attributes.AttributeUtil
- public class AttributeUtil
- extends Object
Commonly used convenience functions.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AttributeUtil
public AttributeUtil()
getClassesWithAttributeType
public static Collection getClassesWithAttributeType(Collection classes,
Class attributeClass)
- Filters a Collection of
Class
objects. The returned collection
only contains those classes that have an attribute of the specified type.
That is, for each Class clazz in the
returned collection,
clazz != null && Attributes.hasAttributeType (clazz, attributeClass)
is true.
- Parameters:
classes
- Collection of Classes to filter. May contain null
references,
but may not itself be null
.attributeClass
- the class to filter based on.
getObjectsWithAttributeType
public static Collection getObjectsWithAttributeType(Collection objects,
Class attributeClass)
- Filters a collection of objects. The returned collection
only contains those objects whose class have an attribute
of the specified type. That is, for each Object o in the
returned collection,
o != null && Attributes.hasAttributeType (o.getClass (), attributeClass)
is true.
- Parameters:
objects
- Collection of objects to filter. May contain null
references,
but may not itself be null
.attributeClass
- the class to filter based on.
Copyright © The Apache Software Foundation. All Rights Reserved.