com.jayway.restassured.internal
Class MultiValueEntity<T extends NameAndValue>

java.lang.Object
  extended by com.jayway.restassured.internal.MultiValueEntity<T>
All Implemented Interfaces:
Iterable<T>

public class MultiValueEntity<T extends NameAndValue>
extends Object
implements Iterable<T>


Constructor Summary
MultiValueEntity(List<T> entities)
           
 
Method Summary
 boolean exist()
           
 T get(String entityName)
          Get a single entity with the supplied name.
 List<T> getList(String entityName)
          Get all entities with the supplied name.
 String getValue(String entityName)
          Get a single entity value with the supplied name.
 List<String> getValues(String entityName)
          Get all entity values of the entity with supplied name.
 boolean hasEntityWithName(String entityName)
          C See if a entity with the given name exists
 Iterator<T> iterator()
           
 List<T> list()
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiValueEntity

public MultiValueEntity(List<T> entities)
Method Detail

size

public int size()
Returns:
The size of the entities

exist

public boolean exist()
Returns:
true if one or more entities are defined, false otherwise.

hasEntityWithName

public boolean hasEntityWithName(String entityName)
C See if a entity with the given name exists

Parameters:
entityName - The name of the entity to check
Returns:
true if the entity exists

list

public List<T> list()

get

public T get(String entityName)
Get a single entity with the supplied name. If there are several entities match the entityName then the first one is returned.

Parameters:
entityName - The name of the entity to find
Returns:
The found entity or null if no entity was found.

getValue

public String getValue(String entityName)
Get a single entity value with the supplied name. If there are several headers match the headerName then the first one is returned.

Parameters:
entityName - The name of the header to find
Returns:
The found entity value or null if no header was found.

getList

public List<T> getList(String entityName)
Get all entities with the supplied name. If there's only one entity matching the entityName then a list with only that entity is returned.

Parameters:
entityName - The name of the entity to find
Returns:
The found entities or empty list if no entity was found.

getValues

public List<String> getValues(String entityName)
Get all entity values of the entity with supplied name. If there's only one header matching the entity name then a list with only that header value is returned.

Parameters:
entityName - The name of the entity to find
Returns:
The found entity values or empty list if no entity was found.

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends NameAndValue>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2012. All Rights Reserved.