|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.assertj.core.groups.Properties<T>
public class Properties<T>
Extracts the values of a specified property from the elements of a given
or array.
Iterable
Method Summary | ||
---|---|---|
static Properties<Object> |
extractProperty(String propertyName)
Creates a new . |
|
static
|
extractProperty(String propertyName,
Class<T> propertyType)
Creates a new . |
|
List<T> |
from(Iterable<?> c)
Extracts the values of the property (specified previously in ) from the elements
of the given . |
|
List<T> |
from(Object[] array)
Extracts the values of the property (specified previously in ) from the elements
of the given array. |
|
|
ofType(Class<U> propertyType)
Specifies the target type of an instance that was previously created with extractProperty(String) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> Properties<T> extractProperty(String propertyName, Class<T> propertyType)
Properties
.
propertyName
- the name of the property to be read from the elements of a Iterable
. It may be a nested
property (e.g. "address.street.number").propertyType
- the type of property to extract
Properties
.
NullPointerException
- if the given property name is null
.
IllegalArgumentException
- if the given property name is empty.public static Properties<Object> extractProperty(String propertyName)
Properties
with given propertyName and Object as property type.
.
propertyName
- the name of the property to be read from the elements of a Iterable
. It may be a nested
property (e.g. "address.street.number").
Properties
.
NullPointerException
- if the given property name is null
.
IllegalArgumentException
- if the given property name is empty.public <U> Properties<U> ofType(Class<U> propertyType)
extractProperty(String)
.
This is so that you can write:
extractProperty("name").ofType(String.class).from(fellowshipOfTheRing)instead of:
extractProperty("name", String.class).from(fellowshipOfTheRing)
propertyType
- the type of property to extract.
Properties
with the given type.public List<T> from(Iterable<?> c)
extractProperty(String)
) from the elements
of the given Iterable
.
c
- the given Iterable
.
Iterable
.
IntrospectionError
- if an element in the given Iterable
does not have a property with a matching name.public List<T> from(Object[] array)
extractProperty(String)
) from the elements
of the given array.
array
- the given array.
IntrospectionError
- if an element in the given array does not have a property with a matching name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |