public class ResultShape<T> extends Object implements Serializable
Constructor and Description |
---|
ResultShape(Class<T> cls)
Construct a non-primitive shape with ASSIGN or ARRAY fill strategy.
|
ResultShape(Class<T> cls,
boolean primitive)
Construct a primitive or non-primitive shape with ASSIGN or ARRAY fill strategy.
|
ResultShape(Class<T> cls,
FillStrategy<T> strategy)
Construct a non-primitive shape with the given fill strategy.
|
ResultShape(Class<T> cls,
FillStrategy<T> strategy,
boolean primitive)
Construct a shape with the given fill strategy.
|
Modifier and Type | Method and Description |
---|---|
ResultShape<T> |
add(Class<?>... classes)
Adds the given classes as child shapes of this shape.
|
int |
argLength()
Total number of arguments required to populate the shape and all its child shapes.
|
String |
getAlias() |
List<ResultShape<?>> |
getChildren()
Gets all the child shapes.
|
List<Class<?>> |
getCompositeTypes()
Gets the list of classes to compose this shape and all its children.
|
Set<ResultShape<?>> |
getParents()
Gets the immediate parents of this shape.
|
FillStrategy<T> |
getStrategy() |
Class<T> |
getType()
Gets the type of instance populated by this shape.
|
List<Class<?>> |
getTypes()
Gets the list of classes to compose this shape only i.e. without expanding the children's shape.
|
boolean |
isCompound()
Affirms if this shape can have child shapes.
|
boolean |
isNested()
Affirms if this shape is nested within other shapes.
|
boolean |
isNesting()
Affirms if at least one child shape of this shape is a compound shape.
|
boolean |
isParent(ResultShape<?> p)
Affirms if the given shape is a parent (or grandparent) of this shape.
|
boolean |
isPrimitive()
Affirms if this shape can not have any child shape.
|
int |
length()
Number of arguments to populate this shape only.
|
<X> ResultShape<X> |
nest(Class<X> cls,
FillStrategy strategy,
Class<?>... classes)
Creates a new shape of type X with the given class arguments and nests
the new shape within this shape.
|
ResultShape<T> |
nest(ResultShape<?> shape)
Nest the given shape.
|
T |
pack(Object[] values,
Class<?>[] types,
String[] aliases)
Fill this shape and its children with the given array element values.
|
ResultShape<T> |
setAlias(String alias) |
String |
toString()
Gets a human-readable representation of this shape.
|
public ResultShape(Class<T> cls)
public ResultShape(Class<T> cls, boolean primitive)
public ResultShape(Class<T> cls, FillStrategy<T> strategy)
public ResultShape(Class<T> cls, FillStrategy<T> strategy, boolean primitive)
public FillStrategy<T> getStrategy()
public ResultShape<T> setAlias(String alias)
public String getAlias()
public List<Class<?>> getCompositeTypes()
public List<Class<?>> getTypes()
public <X> ResultShape<X> nest(Class<X> cls, FillStrategy strategy, Class<?>... classes)
public ResultShape<T> nest(ResultShape<?> shape)
shape
- The given shape can not be a parent of this shape
to prohibit recursive nesting.public ResultShape<T> add(Class<?>... classes)
public List<ResultShape<?>> getChildren()
public boolean isCompound()
public boolean isPrimitive()
public boolean isNesting()
public boolean isNested()
public boolean isParent(ResultShape<?> p)
public Set<ResultShape<?>> getParents()
public int argLength()
public int length()
public T pack(Object[] values, Class<?>[] types, String[] aliases)
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.