public static Iterable<DomainEventValue> events( Iterable<UnitOfWorkDomainEventsValue> transactions ) { return Iterables.flattenIterables( Iterables.map( new Function<UnitOfWorkDomainEventsValue, Iterable<DomainEventValue>>() { @Override public Iterable<DomainEventValue> map( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue ) { return unitOfWorkDomainEventsValue.events().get(); } }, transactions ) ); }
@Override public Iterable<T> map( Type type ) { return flattenIterables( Iterables.map( function, CLASS_HIERARCHY.map( type ) ) ); } };
@Override public Iterable<T> map( Type type ) { return flattenIterables( Iterables.map( function, TYPES_OF.map( type ) ) ); } };
@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 ) ) ) ); } } };
@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() ) ); } } } };
public static Iterable<Annotation> findAccessorAndTypeAnnotationsIn( AccessibleObject accessor ) { return flatten( iterable( accessor.getAnnotations() ), flattenIterables( map( Annotations.ANNOTATIONS_OF, interfacesOf( typeOf( accessor ) ) ) ) ); } }