FluentIterable toSet - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for FluentIterable toSet method.

This code example shows how to use the following methods:toSet
      FluentIterable<Task> expected = expected();
 
      TaskListHandler handler = injector.getInstance(TaskListHandler.class);
      FluentIterable<Task> result = factory.create(handler).parse(is);
 
      assertEquals(result.toSet().toString(), expected.toSet().toString());
   } 
 
   public FluentIterable<Task> expected() {
      return FluentIterable.from(ImmutableSet.<Task> builder()
                           .add(Task.builder() 
                                    .guid("0b40c7dd-748d-4c49-8506-26f0c7d2ea9c") 
                                    .statusCode(StatusCode.COMPLETE) 
                                    .message("Processing complete") 
                                    .resultUrl(URI.create("http://localhost:8008/users/node01/tasks/0b40c7dd-748d-4c49-8506-26f0c7d2ea9c/result"))
                                    .build()) 
                           .build()); 
   } 
 
} 
6
CodeRank
This code example shows how to use the following methods:toSet
      FluentIterable<DirectionalPool> expected = expected();
 
      DirectionalPoolListHandler handler = injector.getInstance(DirectionalPoolListHandler.class);
      FluentIterable<DirectionalPool> result = factory.create(handler).parse(is);
 
      assertEquals(result.toSet().toString(), expected.toSet().toString());
   } 
 
   public FluentIterable<DirectionalPool> expected() {
      return FluentIterable.from(ImmutableList.<DirectionalPool> builder()
                           .add(DirectionalPool.builder() 
                                               .zoneId("0000000000000001") 
                                               .id("000000000000000A") 
                                               .dname("mixy.jclouds.org.") 
                                               .type(Type.MIXED) 
                                               .tieBreak(TieBreak.GEOLOCATION) 
                                               .name("mixy").build()) 
                           .add(DirectionalPool.builder() 
                                               .zoneId("0000000000000002") 
                                               .id("000000000000000B") 
6
CodeRank
This code example shows how to use the following methods:toSet
      FluentIterable<AccountLevelGroup> expected = expected();
 
      AccountLevelGroupsHandler handler = injector.getInstance(AccountLevelGroupsHandler.class);
      FluentIterable<AccountLevelGroup> result = factory.create(handler).parse(is);
 
      assertEquals(result.toSet().toString(), expected.toSet().toString());
   } 
 
   public FluentIterable<AccountLevelGroup> expected() {
      return FluentIterable.from(ImmutableList.<AccountLevelGroup> builder()
                           .add(AccountLevelGroup.builder() 
                                                 .id("000000000000000A") 
                                                 .name("ASIA") 
                                                 .type(Type.GEOLOCATION) 
                                                 .recordCount(0).build()) 
                           .add(AccountLevelGroup.builder() 
                                                 .id("000000000000000B") 
                                                 .name("EU") 
                                                 .type(Type.GEOLOCATION) 
                                                 .recordCount(3).build()) 
6
CodeRank
This code example shows how to use the following methods:toSet
      FluentIterable<Zone> expected = expected();
 
      ZoneListHandler handler = injector.getInstance(ZoneListHandler.class);
      FluentIterable<Zone> result = factory.create(handler).parse(is);
 
      assertEquals(result.toSet().toString(), expected.toSet().toString());
   } 
 
   public FluentIterable<Zone> expected() {
      return FluentIterable.from(ImmutableSet.<Zone> builder()
                           .add(Zone.builder() 
                                    .name("jclouds.org.") 
                                    .typeCode(1) 
                                    .accountId("AAAAAAAAAAAAAAAA") 
                                    .ownerId("EEEEEEEEEEEEEEEE") 
                                    .id("0000000000000001") 
                                    .dnssecStatus(DNSSECStatus.UNSIGNED).build()) 
                           .add(Zone.builder() 
                                    .name("0.1.2.3.4.5.6.7.ip6.arpa.") 
                                    .typeCode(1) 
6
CodeRank
This code example shows how to use the following methods:toSet
      FluentIterable<TrafficControllerPoolRecordDetail> expected = expected();
 
      TrafficControllerPoolRecordDetailListHandler handler = injector.getInstance(TrafficControllerPoolRecordDetailListHandler.class);
      FluentIterable<TrafficControllerPoolRecordDetail> result = factory.create(handler).parse(is);
 
      assertEquals(result.toSet().toString(), expected.toSet().toString());
   } 
 
   public FluentIterable<TrafficControllerPoolRecordDetail> expected() {
      return FluentIterable.from(ImmutableSet.<TrafficControllerPoolRecordDetail> builder()
                           .add(TrafficControllerPoolRecordDetail.builder() 
                                                           .id("0000000000000001") 
                                                           .poolId("0000000000000001") 
                                                           .record(createCNAME("canary.jclouds.org.")) 
                                                           .weight(2) 
                                                           .priority(2) 
                                                           .forceAnswer("Normal") 
                                                           .probingEnabled(true) 
                                                           .status(OK) 
                                                           .serving(true) 
6
CodeRank
This code example shows how to use the following methods:toSet
This code example shows how to use the following methods:filter, toSet
    return FluentIterable.from(resources).filter(ClassInfo.class).toSet();
  } 
 
  /** Returns all top level classes loadable from the current class path. */ 
  public ImmutableSet<ClassInfo> getTopLevelClasses() { 
    return FluentIterable.from(resources).filter(ClassInfo.class).filter(IS_TOP_LEVEL).toSet();
  } 
 
  /** Returns all top level classes whose package name is {@code packageName}. */ 
  public ImmutableSet<ClassInfo> getTopLevelClasses(String packageName) {
    checkNotNull(packageName);
    ImmutableSet.Builder<ClassInfo> builder = ImmutableSet.builder();
    for (ClassInfo classInfo : getTopLevelClasses()) {
      if (classInfo.getPackageName().equals(packageName)) {
        builder.add(classInfo);
      } 
    } 
    return builder.build();
  } 
 
5
CodeRank
This code example shows how to use the following methods:toSet
    } 
 
    public ImmutableSet<String> getPropertyNames(){
        return FluentIterable.from(Arrays.asList(annotation.annotationType().getDeclaredMethods()))
                .transform(new MethodNameExtractor())
                .toSet();
    } 
 
    private static final class MethodNameExtractor implements Function<Method, String> {
        @Override 
        public String apply(Method input) {
            return input.getName();
        } 
    } 
 
    @Override 
    public <T> T getProperty(String name, Class<T> type) {
        try { 
            Method annotationParameter = annotation.annotationType().getDeclaredMethod(name);
 
5
CodeRank
This code example shows how to use the following methods:toSet
  @Override 
  public final Set<T> getNextGroup(Set<T> idle, Set<T> active) {
    return FluentIterable
        .from(ordering.sortedCopy(doGetNextGroup(idle, active)))
        .limit(Math.max(0, maxActive - active.size()))
        .toSet();
  } 
 
  /** 
   * Delegate function for the subclass. The implementation may return as many or few results 
   * as they wish. If the result is larger than {@link #maxActive}, it will be truncated. 
   * 
   * @param idle Idle instances, candidate for being updated. 
   * @param active Instances currently being updated. 
   * @return A subset of {@code idle}, instances to start updating. 
   */ 
  abstract Set<T> doGetNextGroup(Set<T> idle, Set<T> active);
} 
4
CodeRank
This code example shows how to use the following methods:toSet
	/** 
	 * @return 
	 * @see com.google.common.collect.FluentIterable#toSet() 
	 */ 
	public final ImmutableSet<O> toSet() {
		return source.toSet();
	} 
 
	/** 
	 * @param valueFunction 
	 * @return 
	 * @see com.google.common.collect.FluentIterable#toMap(com.google.common.base.Function) 
	 */ 
	public final <V> ImmutableMap<O, V> toMap(Function<? super O, V> valueFunction) {
		return source.toMap(valueFunction);
	} 
 
	/** 
	 * @param keyFunction 
	 * @return 
3
CodeRank
toSet Method Overview
Returns an ImmutableSet containing all of the elements from this fluent iterable with duplicates removed.
See Code Examples for other Guava FluentIterable Methods: