org.apache.commons.attributes
Class AttributeUtil

java.lang.Object
  extended byorg.apache.commons.attributes.AttributeUtil

public class AttributeUtil
extends Object

Commonly used convenience functions.

Since:
2.1

Constructor Summary
AttributeUtil()
           
 
Method Summary
static Collection getClassesWithAttributeType(Collection classes, Class attributeClass)
          Filters a Collection of Class objects.
static Collection getObjectsWithAttributeType(Collection objects, Class attributeClass)
          Filters a collection of objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeUtil

public AttributeUtil()
Method Detail

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.
Since:
2.1

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.
Since:
2.1


Copyright © The Apache Software Foundation. All Rights Reserved.