org.omnaest.utils.operation.foreach
Class ForEach.Result<V>

java.lang.Object
  extended by org.omnaest.utils.structure.collection.list.decorator.ListDecorator<V>
      extended by org.omnaest.utils.operation.foreach.ForEach.Result<V>
Type Parameters:
V -
All Implemented Interfaces:
Serializable, Iterable<V>, Collection<V>, List<V>
Enclosing class:
ForEach<E,V>

public static class ForEach.Result<V>
extends ListDecorator<V>

ForEach.Result of a ForEach Operation which is basically an unmodifiable List of all returned instances from the Operations.

Additionally there a some special methods.
E.g. the areAllValuesEqualTo(Object) allows to test for equality of the whole result objects:

 boolean result = new ForEach<String, Boolean>( iterables ).execute( operation ).areAllValuesEqualTo( true );
 

Author:
Omnaest
See Also:
#convert(CollectionConverter), areAllValuesEqualTo(Object), areNumberOfValuesEqualTo(Object, int), isAnyValueEqualTo(Object), Serialized Form

Field Summary
 
Fields inherited from class org.omnaest.utils.structure.collection.list.decorator.ListDecorator
list
 
Constructor Summary
protected ForEach.Result(List<V> list)
           
 
Method Summary
 boolean areAllValuesEqualTo(V value)
          Returns true if all values of the ForEach.Result are equal to the given value
 boolean areNumberOfValuesEqualTo(V value, int number)
          Returns true if a given number of values of the result are equal to the given value
<TO> TO
convert(CollectionUtils.CollectionConverter<V,TO> collectionConverter)
          Converts the ForEach.Result to a single value using a CollectionUtils.CollectionConverter
 boolean isAnyValueEqualTo(V value)
          Returns true if any value of the result is equal to the given value
 
Methods inherited from class org.omnaest.utils.structure.collection.list.decorator.ListDecorator
add, add, addAll, addAll, clear, contains, containsAll, equals, get, getList, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, setList, size, subList, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ForEach.Result

protected ForEach.Result(List<V> list)
Parameters:
list -
See Also:
ForEach.Result
Method Detail

convert

public <TO> TO convert(CollectionUtils.CollectionConverter<V,TO> collectionConverter)
Converts the ForEach.Result to a single value using a CollectionUtils.CollectionConverter

Parameters:
collectionConverter -
Returns:

areAllValuesEqualTo

public boolean areAllValuesEqualTo(V value)
Returns true if all values of the ForEach.Result are equal to the given value

Parameters:
value -
Returns:

isAnyValueEqualTo

public boolean isAnyValueEqualTo(V value)
Returns true if any value of the result is equal to the given value

Parameters:
value -
Returns:

areNumberOfValuesEqualTo

public boolean areNumberOfValuesEqualTo(V value,
                                        int number)
Returns true if a given number of values of the result are equal to the given value

Parameters:
value -
number -
Returns:


Copyright © 2013. All Rights Reserved.