Guava ImmutableSet.Builder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava ImmutableSet.Builder class.

This code example shows how to use the following methods:add, build
public class CloudIdentityAuthenticationModule extends KeystoneAuthenticationModule { 
 
   @Override 
   protected Map<String, Function<Credentials, Access>> authenticationMethods(Injector i) { 
      Builder<Function<Credentials, Access>> fns = ImmutableSet.<Function<Credentials, Access>> builder(); 
      fns.add(i.getInstance(AuthenticatePasswordCredentials.class)); 
      fns.add(i.getInstance(AuthenticateApiKeyCredentials.class)); 
      return CredentialTypes.indexByCredentialType(fns.build()); 
   } 
 
} 

8
CodeRank
This code example shows how to use the following methods:add, build
   } 
 
   @Override 
   public Set<? extends Hardware> get() {
      Builder<Hardware> sizes = ImmutableSet.builder();
      sizes.add(cc1_4xlarge().supportsImageIds(ccAmis).build());
      sizes.add(cg1_4xlarge().supportsImageIds(ccAmis).build());
      sizes.add(cc2_8xlarge().supportsImageIds(ccAmis).build());
      sizes.add(hi1_4xlarge().supportsImageIds(ccAmis).build());
      sizes.add(hs1_8xlarge().supportsImageIds(ccAmis).build());
      sizes.add(g2_2xlarge().supportsImageIds(ccAmis).build());
 
      sizes.add(t1_micro().build());
      sizes.add(t2_micro().build());
      sizes.add(t2_small().build());
      sizes.add(t2_medium().build());
      sizes.add(c1_medium().build());
      sizes.add(c1_xlarge().build());
      sizes.add(c3_large().build());
      sizes.add(c3_xlarge().build());

7
CodeRank
This code example shows how to use the following methods:add, addAll, build
This code example shows how to use the following methods:add
 
   @Override 
   public void startElement(String url, String name, String qName, Attributes attrs) {
      if (equalsOrSuffix(qName, "AccountLevelGroups")) {
         Map<String, String> attributes = cleanseAttributes(attrs);
         groups.add(AccountLevelGroup.builder()
                                     .id(attributes.get("GroupId"))
                                     .name(attributes.get("GroupName"))
                                     .type(Type.valueOf(attributes.get("GroupType")))
                                     .recordCount(Integer.parseInt(attributes.get("RecordsCount")))
                                     .build()); 
      } 
   } 
} 
6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:build
                     .getInboundPorts(), true); 
         } 
         // this will create if not yet exists. 
         securityGroupMap.getUnchecked(regionNameAndIngressRulesForMarkerGroup); 
      } 
      return groups.build(); 
   } 
 
   protected boolean userSpecifiedTheirOwnGroups(TemplateOptions options) { 
      return options instanceof EC2TemplateOptions && !EC2TemplateOptions.class.cast(options).getGroups().isEmpty(); 
   } 
 
   // allows us to mock this method 
   @VisibleForTesting 
   public javax.inject.Provider<RunInstancesOptions> getOptionsProvider() { 
      return optionsProvider; 
   } 
} 

6
CodeRank
This code example shows how to use the following methods:build
   public DescribeSpotPriceHistoryResponseHandler(SpotHandler spotHandler) {
      this.spotHandler = spotHandler;
   } 
 
   public Set<Spot> getResult() {
      return spots.build();
   } 
 
   @Override 
   public HandlerWithResult<Set<Spot>> setContext(HttpRequest request) {
      spotHandler.setContext(request);
      return super.setContext(request);
   } 
 
   @Override 
   public void startElement(String uri, String localName, String qName, Attributes attributes)
            throws SAXException {
      if (!qName.equals("item"))
         spotHandler.startElement(uri, localName, qName, attributes);
   } 
6
CodeRank
This code example shows how to use the following methods:add
   } 
 
   @Override 
   public void endElement(String uri, String name, String qName) {
      if (equalsOrSuffix(qName, "ResourceRecord")) {
         rrs.add(resourceRecordHandler.getResult());
      } 
   } 
} 
6
CodeRank
This code example shows how to use the following methods:add
   } 
 
   @Override 
   public void endElement(String uri, String name, String qName) {
      if (equalsOrSuffix(qName, "DirectionalDNSRecordDetail")) {
         drs.add(directionalRecordHandler.getResult());
      } 
   } 
} 
6
CodeRank
This code example shows how to use the following methods:build
   public SpotInstancesHandler(SpotInstanceHandler spotRequestHandler) {
      this.spotRequestHandler = spotRequestHandler;
   } 
 
   public Set<SpotInstanceRequest> getResult() {
      return spotRequests.build();
   } 
 
   @Override 
   public HandlerWithResult<Set<SpotInstanceRequest>> setContext(HttpRequest request) {
      spotRequestHandler.setContext(request);
      return super.setContext(request);
   } 
 
   @Override 
   public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
      if (qName.equals("item"))
         itemDepth++;
      if (itemDepth >= 1)
         spotRequestHandler.startElement(uri, localName, qName, attributes);
6
CodeRank
See Code Examples for Guava ImmutableSet.Builder Methods: