@Override public Query filter( Specification<T> filter ) { iterable = Iterables.filter( filter, iterable ); return this; }
@Override public DataSet<T> constrain( Specification<T> selection ) { return new IterableDataSet<T>( Iterables.filter( selection, iterable ) ); }
public static boolean matches( Specification<ApplicationEvent> specification, Iterable<TransactionApplicationEvents> transactions ) { return Iterables.filter( specification, events( transactions ) ).iterator().hasNext(); }
@Override public Field map( Class<?> aClass, String name ) { return Iterables.first( Iterables.filter( Classes.memberNamed( name ), FIELDS_OF.map( aClass ) ) ); } };
@Override public void assemble( ModuleAssembly module ) throws AssemblyException { for( Class<?> aClass : filter( isAssignableFrom( ValueComposite.class ), findClasses( Resource.class ) )) { module.values( aClass ).visibleIn( Visibility.application ); } } }
@Override public Link query( String relation ) { return Iterables.single( Iterables.filter( LinksUtil.withRel( relation ), queries().get() ) ); }
public static Link withRel(String rel, Links links) { return Iterables.single( Iterables.filter( withRel( rel ), links.links().get() ) ); }
@Override public Link command( String relation ) { return Iterables.single(Iterables.filter( LinksUtil.withRel( relation ), commands().get() )); }
@Override public Link resource( String relation ) { return Iterables.single(Iterables.filter( LinksUtil.withRel( relation ), resources().get() )); } }
public static Link withId(String id, Links links) { return Iterables.single( Iterables.filter( withId( id ), links.links().get() ) ); }
for( Annotation[] annotations : method.getParameterAnnotations() ) Name name = (Name) first( filter( isType( Name.class ), iterable( annotations ) ) );
@Override public T importService( final ImportedServiceDescriptor serviceDescriptor ) throws ServiceImporterException { T instance = null; Iterable<MetaInfoHolder> holders = Iterables.iterable( serviceDescriptor, module, layer, application ); for( final MetaInfoHolder metaInfoHolder : holders ) { Function<Class<?>, T> metaFinder = new Function<Class<?>, T>() { @Override @SuppressWarnings( "unchecked" ) public T map( Class<?> type ) { return (T) metaInfoHolder.metaInfo( type ); } }; instance = first( filter( notNull(), map( metaFinder, serviceDescriptor.types() ) ) ); if( instance != null ) { break; } } return instance; }
Name name = (Name) first( filter( isType( Name.class ), iterable( annotations ) ) ); form.add( name.value(), getValue( name.value(), queryAsForm, entityAsForm ) );
Specification<Class<?>> responseWriterClass = isAssignableFrom( ResponseWriter.class ); Specification<Class<?>> isNotAnAbstract = not( hasModifier( Modifier.ABSTRACT ) ); Iterable<Class<?>> candidates = filter( and( isNotAnAbstract, responseWriterClass ), writers ); for( Class<?> responseWriter : candidates )