@Override public Iterable<Constructor<?>> map( Class<?> type ) { return iterable( type.getDeclaredConstructors() ); } } );
@Override public Iterable<Field> map( Class<?> type ) { return iterable( type.getDeclaredFields() ); } } );
@Override public Iterable<Method> map( Type type ) { return iterable( Classes.RAW_CLASS.map( type ).getDeclaredMethods() ); } } );
@Override public Iterable<Annotation> map( Type type ) { return Iterables.iterable( Classes.RAW_CLASS.map( type ).getAnnotations() ); } } );
public static Iterable<DomainEventValue> events( UnitOfWorkDomainEventsValue... unitOfWorkDomainValues ) { return events( Iterables.iterable( unitOfWorkDomainValues ) ); }
}, Iterables.iterable( mixinTypes ) ); return Iterables.fold( new Function<String, String>()
@Override public Iterable<Type> map( Type type ) { Class clazz = RAW_CLASS.map( type ); if( clazz.isInterface() ) { Iterable<Type> genericInterfaces = iterable( clazz.getGenericInterfaces() ); Iterable<Type> flattenIterables = flattenIterables( Iterables.map( INTERFACES_OF, genericInterfaces ) ); return prepend( type, flattenIterables ); } else { if( type.equals( Object.class ) ) { return iterable( clazz.getGenericInterfaces() ); } else { return flatten( flattenIterables( Iterables.map( INTERFACES_OF, iterable( clazz.getGenericInterfaces() ) ) ), INTERFACES_OF.map( RAW_CLASS.map( type ).getSuperclass() ) ); } } } };
@SuppressWarnings( "unchecked" ) public AndSpecification and( Specification<Composite> specification ) { if( this instanceof AndSpecification ) { return new AndSpecification( append( specification, ( (AndSpecification) this ).operands() ) ); } else { return new AndSpecification( iterable( this, specification ) ); } }
@SuppressWarnings( "unchecked" ) public OrSpecification or( Specification<Composite> specification ) { if( this instanceof OrSpecification ) { return new OrSpecification( append( specification, ( (OrSpecification) this ).operands() ) ); } else { return new OrSpecification( iterable( this, specification ) ); } }
@Override @SuppressWarnings( {"raw", "unchecked"} ) public Iterable<Class<?>> map( Type type ) { if( type == null ) { return empty(); } if( type.equals( Object.class ) ) { Class<?> aClass = (Class<?>) type; return cast( iterable( aClass ) ); } else { type = RAW_CLASS.map( type ); Class superclass = ( (Class) type ).getSuperclass(); return prepend( (Class<?>) type, map( superclass ) ); } } };
public static Iterable<Annotation> findAccessorAndTypeAnnotationsIn( AccessibleObject accessor ) { return flatten( iterable( accessor.getAnnotations() ), flattenIterables( map( Annotations.ANNOTATIONS_OF, interfacesOf( typeOf( accessor ) ) ) ) ); } }
@Override public Iterable<Type> map( Type type ) { Class clazz = RAW_CLASS.map( type ); if( clazz.isInterface() ) { Iterable<Type> genericInterfaces = iterable( clazz.getGenericInterfaces() ); Iterable<Type> flattenIterables = flattenIterables( Iterables.map( INTERFACES_OF, genericInterfaces ) ); return prepend( clazz, flattenIterables ); } else { return flatten( CLASS_HIERARCHY.map( type ), flattenIterables( Iterables.map( INTERFACES_OF, CLASS_HIERARCHY.map( type ) ) ) ); } } };
@Test public void givenIterableTypeWithByteAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { String output = valueSerialization.serialize( Iterables.iterable( byteCollection().toArray() ) ); CollectionType collectionType = new CollectionType( List.class, new ValueType( Byte.class ) ); List<Byte> list = valueSerialization.deserialize( collectionType, output ); assertEquals( byteCollection(), list ); }
@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 ) );
Inputs.iterable( Iterables.iterable( unitOfWorkDomainValue ) ).transferTo( eventOutput );