Guava ImmutableList.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 ImmutableList.Builder class.

This code example shows how to use the following methods:add, addAll, build
This code example shows how to use the following methods:add, addAll, build
This code example shows how to use the following methods:add, addAll, build
This code example shows how to use the following methods:add, addAll
        configure(builder); 
        super.setConfigLocations(Lists.transform(builder.build(), TO_FQN).toArray(new String[0])); 
    } 
 
    private void configure(Builder<Class<?>> builder) { 
        builder.add(AtlasModule.class);         
        builder.add(AtlasLoggingModule.class, MongoContentPersistenceModule.class, CassandraPersistenceModule.class, AtlasFetchModule.class, RemoteSiteModule.class); 
        builder.addAll(new RemoteSiteModuleConfigurer().enabledModules()); 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:add, build
    } 
 
    private String oauth() throws ClientProtocolException, IOException {
        HttpPost post = new HttpPost(GETTY_OAUTH_URL);
 
        Builder<BasicNameValuePair> params = new ImmutableList.Builder<BasicNameValuePair>();
        params.add(new BasicNameValuePair("grant_type", "password"));
        params.add(new BasicNameValuePair("client_id", clientId));
        params.add(new BasicNameValuePair("client_secret", clientSecret));
        params.add(new BasicNameValuePair("username", username));
        params.add(new BasicNameValuePair("password", password));
        // This could, if necessary, hold a refresh token instead of the username and password. 
        // The refresh token would, however, expire after a year, as well as if the password changed. 
        // See https://github.com/gettyimages/connect/blob/master/oauth2.md 
 
        post.setEntity(new UrlEncodedFormEntity(params.build()));
 
        HttpResponse resp = new DefaultHttpClient().execute(post);
        InputStreamReader reader = new InputStreamReader(resp.getEntity().getContent());
        return CharStreams.toString(reader);
    } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:add, build
        return Arrays.asList(str);
    } 
 
    public static List<String> stringList(String str, String... strs) {
        Builder<String> builder = ImmutableList.builder();
        builder.add(str);
        builder.add(strs);
        return builder.build();
    } 
} 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:add, addAll
		configure(builder);
		super.setConfigLocations(Lists.transform(builder.build(), TO_FQN).toArray(new String[0]));
	} 
 
    private void configure(Builder<Class<?>> builder) {
        builder.add(
            AtlasModule.class, 
            AtlasLoggingModule.class, 
            AtlasWebModule.class, 
            SearchModule.class, 
            QueryModule.class, 
            MongoContentPersistenceModule.class, 
            CassandraPersistenceModule.class,  
            AtlasFetchModule.class, 
            RemoteSiteModule.class,  
            HealthModule.class, 
            RadioPlayerModule.class, 
            XmlTvModule.class,  
            RemoteSiteHealthModule.class,  
            EquivModule.class, 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:build
   } 
 
   @Override 
   public HostedZoneAndNameServers getResult() { 
      try { 
         return HostedZoneAndNameServers.create(zone, nameServers.build());
      } finally { 
         zone = null;
         nameServers = ImmutableList.<String> builder();
      } 
   } 
 
   @Override 
   public void startElement(String url, String name, String qName, Attributes attributes) {
      if (equalsOrSuffix(qName, "HostedZone")) {
         inHostedZone = true;
      } 
      if (inHostedZone) {
         zoneHandler.startElement(url, name, qName, attributes);
      } 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:add
   @Override 
   public void endElement(String uri, String name, String qName) {
      if (equalsOrSuffix(qName, "ReceiveMessageResult")) {
         inMessages = false;
      } else if (equalsOrSuffix(qName, "Message")) {
         messages.add(messageHandler.getResult());
      } else if (inMessages) {
         messageHandler.endElement(uri, name, qName);
      } 
   } 
 
   @Override 
   public void characters(char ch[], int start, int length) {
      if (inMessages) {
         messageHandler.characters(ch, start, length);
      } 
   } 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:add
   public void endElement(String uri, String name, String qName) {
      if (inHostedZones) {
         if (qName.equals("HostedZones")) {
            inHostedZones = false;
         } else if (qName.equals("HostedZone")) {
            zones.add(zoneHandler.getResult());
         } else { 
            zoneHandler.endElement(uri, name, qName);
         } 
      } else if (qName.equals("NextMarker")) {
         afterMarker = currentOrNull(currentText);
      } 
 
      currentText.setLength(0);
   } 
 
   @Override 
   public void characters(char ch[], int start, int length) {
      if (inHostedZones) {
         zoneHandler.characters(ch, start, length);
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Guava ImmutableList.Builder Methods: