Project

General

Profile

« Previous | Next » 

Revision 49642

java8 streams all the way

View differences:

modules/cnr-enabling-services/trunk/src/main/java/eu/dnetlib/enabling/is/sn/resourcestate/hib/HibernateResourceStateSubscriptionDAOImpl.java
2 2

  
3 3
import java.util.Collection;
4 4
import java.util.List;
5
import java.util.stream.Collectors;
5 6

  
6 7
import org.apache.commons.lang.StringUtils;
7 8
import org.apache.commons.logging.Log;
......
33 34
	private SessionFactory sessionFactory;
34 35

  
35 36
	private Collection<ResourceStateSubscription> transformToSubscription(final List<Object> inputList) {
36
		return Collections2.transform(inputList, new Function<Object, ResourceStateSubscription>() {
37

  
38
			@Override
39
			public ResourceStateSubscription apply(final Object input) {
40

  
41
				return (ResourceStateSubscription) input;
42
			}
43

  
44
		});
37
		return inputList.stream()
38
				.map(o -> (ResourceStateSubscription) o)
39
				.collect(Collectors.toList());
45 40
	}
46 41

  
47 42
	/**

Also available in: Unified diff