List of usage examples for com.google.common.collect FluentIterable from
@Deprecated @CheckReturnValue public static <E> FluentIterable<E> from(FluentIterable<E> iterable)
From source file:fr.javatronic.damapping.test.fullhardcoded.mapping.HotelToHotelDto.java
@Nullable public HotelDto apply(@Nullable Hotel hotel) { return new HotelDto(FluentIterable.from(hotel.getFloors()).transform(floorToFloorDtoMapper).toList()); }
From source file:org.obm.imap.archive.dto.HistoryDto.java
public static HistoryDto from(List<ArchiveTreatment> archiveTreatments) { HistoryDto dto = new HistoryDto(); dto.archiveTreatmentDtos = FluentIterable.from(archiveTreatments) .transform(new Function<ArchiveTreatment, ArchiveTreatmentDto>() { @Override//from w w w. j a v a2 s .co m public ArchiveTreatmentDto apply(ArchiveTreatment archiveTreatment) { return ArchiveTreatmentDto.from(archiveTreatment); } }).toList(); return dto; }
From source file:com.tngtech.archunit.library.plantuml.PlantUmlComponents.java
PlantUmlComponents(Set<PlantUmlComponent> components) {
componentsByName = FluentIterable.from(components).uniqueIndex(GET_COMPONENT_NAME);
componentsByAlias = FluentIterable.from(components).filter(WITH_ALIAS).uniqueIndex(TO_EXISTING_ALIAS);
}
From source file:org.mayocat.accounts.store.memory.MemoryTenantStore.java
public Tenant findBySlug(String slug) { return FluentIterable.from(findAll(0, 0)).filter(withSlug(slug)).first().orNull(); }
From source file:org.mutabilitydetector.cli.NamesFromClassResources.java
public List<Dotted> asDotted(String[] findResources) { return FluentIterable.from(asList(findResources)).transform(TO_DOTTED_STRING) .filter(containsPattern(classNameRegex)).transform(STRING_NAME_TO_DOTTED).toImmutableList(); }
From source file:com.cognifide.aet.job.common.comparators.statuscodes.StatusCodesFilter.java
public List<StatusCode> filter(List<StatusCode> codes) { return FluentIterable.from(codes).filter(new StatusCodeFilterPredicate()).toList(); }
From source file:br.com.caelum.vraptor.interceptor.CustomAcceptsVerifier.java
public static List<Annotation> getCustomAcceptsAnnotations(Class<?> clazz) { return FluentIterable.from(asList(clazz.getAnnotations())).filter(acceptsConstraintMatcher()).toList(); }
From source file:fr.javatronic.damapping.test.fullhardcoded.mapping.FloorToFloorDto.java
@Nullable @Override public FloorDto apply(@Nullable Floor floor) { return new FloorDto(FluentIterable.from(floor.getRooms()).transform(roomToRoomDto).toList()); }
From source file:com.github.tomakehurst.wiremock.servlet.WireMockHttpServletMultipartAdapter.java
public WireMockHttpServletMultipartAdapter(final Part servletPart) { mPart = servletPart;//from w w w . j ava 2 s. c o m Iterable<HttpHeader> httpHeaders = FluentIterable.from(mPart.getHeaderNames()) .transform(new Function<String, HttpHeader>() { @Override public HttpHeader apply(String name) { Collection<String> headerValues = servletPart.getHeaders(name); return HttpHeader.httpHeader(name, headerValues.toArray(new String[headerValues.size()])); } }); headers = new HttpHeaders(httpHeaders); }
From source file:ratpack.spring.internal.SpringRegistryBacking.java
@Override public <T> Iterable<Supplier<? extends T>> provide(TypeToken<T> type) { return FluentIterable .from(Arrays.asList(/*from ww w .jav a 2 s. c om*/ BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, type.getRawType()))) .transform(beanName -> () -> { @SuppressWarnings("unchecked") T bean = (T) beanFactory.getBean(beanName); return bean; }); }