org.fest.assertions.groups
Class Properties

java.lang.Object
  extended by org.fest.assertions.groups.Properties

public class Properties
extends Object

Extracts the values of a specified property from the elements of a given Collection or array.

Author:
Yvonne Wang

Method Summary
static Properties extractProperty(String propertyName)
          Creates a new Properties.
 List<?> from(Collection<?> c)
          Extracts the values of the property (specified previously in extractProperty(String)) from the elements of the given Collection.
 List<?> from(Object[] array)
          Extracts the values of the property (specified previously in extractProperty(String)) from the elements of the given array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extractProperty

public static Properties extractProperty(String propertyName)
Creates a new Properties.

Parameters:
propertyName - the name of the property to be read from the elements of a Collection. It may be a nested property (e.g. "address.street.number").
Returns:
the created Properties.
Throws:
NullPointerException - if the given property name is null.
IllegalArgumentException - if the given property name is empty.

from

public List<?> from(Collection<?> c)
Extracts the values of the property (specified previously in extractProperty(String)) from the elements of the given Collection.

Parameters:
c - the given Collection.
Returns:
the values of the previously specified property extracted from the given Collection.
Throws:
org.fest.util.IntrospectionError - if an element in the given Collection does not have a property with a matching name.

from

public List<?> from(Object[] array)
Extracts the values of the property (specified previously in extractProperty(String)) from the elements of the given array.

Parameters:
array - the given array.
Returns:
the values of the previously specified property extracted from the given array.
Throws:
org.fest.util.IntrospectionError - if an element in the given array does not have a property with a matching name.


Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.