public class Properties<T>
extends java.lang.Object
Iterable or array.| Modifier and Type | Method and Description |
|---|---|
static Properties<java.lang.Object> |
extractProperty(java.lang.String propertyName)
Creates a new
. |
static <T> Properties<T> |
extractProperty(java.lang.String propertyName,
java.lang.Class<T> propertyType)
Creates a new
. |
java.lang.Iterable<T> |
from(java.lang.Iterable<?> c)
Extracts the values of the property (specified previously in
) from the elements
of the given . |
java.lang.Iterable<T> |
from(java.lang.Object[] array)
Extracts the values of the property (specified previously in
) from the elements
of the given array. |
<U> Properties<U> |
ofType(java.lang.Class<U> propertyType)
Specifies the target type of an instance that was previously created with
extractProperty(String). |
public static <T> Properties<T> extractProperty(java.lang.String propertyName, java.lang.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 extractProperties.java.lang.NullPointerException - if the given property name is null.java.lang.IllegalArgumentException - if the given property name is empty.public static Properties<java.lang.Object> extractProperty(java.lang.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.java.lang.NullPointerException - if the given property name is null.java.lang.IllegalArgumentException - if the given property name is empty.public <U> Properties<U> ofType(java.lang.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 java.lang.Iterable<T> from(java.lang.Iterable<?> c)
extractProperty(String)) from the elements
of the given Iterable.c - the given Iterable.Iterable.org.fest.util.IntrospectionError - if an element in the given Iterable does not have a property with a matching name.public java.lang.Iterable<T> from(java.lang.Object[] array)
extractProperty(String)) from the elements
of the given array.array - the given array.org.fest.util.IntrospectionError - if an element in the given array does not have a property with a matching name.Copyright © 2007–2018. All rights reserved.