Package com.google.common.base

Examples of com.google.common.base.Joiner


*/
public final class FolderJUnitTest {

    @Test
    public void ensureVarargsConstructorWorks() {
        Joiner joiner = Joiner.on(System.getProperty("file.separator"));
        String childPath = joiner.join(new String[] { "a", "b", "c" });
        File root = new File("root");
        Folder folder = new Folder(root, "a", "b", "c");
        String expectedPath = new File(root, childPath).getAbsolutePath();
        assertEquals(expectedPath, folder.getAbsolutePath());
    }
View Full Code Here


        byte[] entity = request.getEntity();
        if(entity != null){
            httpRequest = httpRequest.content(new BytesContentProvider(entity),request.getContentType());
        }

        Joiner joiner = Joiner.on(",").skipNulls();

        Map<String, Collection<String>> headers = request.getHeaders();
        for (Map.Entry<String, Collection<String>> stringCollectionEntry : headers.entrySet()) {
            String key = stringCollectionEntry.getKey();
            Collection<String> stringCollection = stringCollectionEntry.getValue();
            String value = joiner.join(stringCollection);
            httpRequest = httpRequest.header(key, value);
        }

        for (Map.Entry<String, Collection<String>> stringCollectionEntry : request.getQueryParams().entrySet()) {
            String key = stringCollectionEntry.getKey();
            Collection<String> stringCollection = stringCollectionEntry.getValue();
            String value = joiner.join(stringCollection);
            httpRequest = httpRequest.param(key, value);
        }
        return httpRequest;
    }
View Full Code Here

        }

        if (!resourceConfigs.isEmpty()) {
            command.add("-c");

            Joiner joiner = Joiner.on(',');
            command.add(joiner.join(resourceConfigs));
        }

        if (symbolOutputDir != null &&
                (type == VariantConfiguration.Type.LIBRARY || !libraries.isEmpty())) {
            command.add("--output-text-symbols");
View Full Code Here

        }

        if (!resourceConfigs.isEmpty()) {
            command.add("-c");

            Joiner joiner = Joiner.on(',');
            command.add(joiner.join(resourceConfigs));
        }

        if (symbolOutputDir != null &&
                (type == VariantConfiguration.Type.LIBRARY || !libraries.isEmpty())) {
            command.add("--output-text-symbols");
View Full Code Here

        return from.getPath().substring( dir.getPath().length() + 1 );
      }
    } ) );
    Collections.sort( names );

    Joiner joiner = Joiner.on( "\n" );
    return joiner.join( names );
  }
View Full Code Here

    @Override
    public HttpResponse executeDirect(HttpRequest request) {

        HttpUriRequest httpUriRequest = null;

        Joiner joiner = Joiner.on(",").skipNulls();
        URI requestUri = buildUri(request, joiner);

        httpUriRequest = buildHttpUriRequest(request, joiner, requestUri);

        try {
View Full Code Here

    public void setDependenciesList(List<Dependency> dependencies) {
        //TODO Разобраться с группами зависимостей
        if (dependencies == null || dependencies.isEmpty()) {
            this.dependencies = "";
        } else {
            Joiner joiner = Joiner.on(", ").skipNulls();
            this.dependencies = joiner.join(dependencies);
        }
    }
View Full Code Here

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;

public class FindMissingPermutation {
  public static void main(String[] args) {
    Joiner joiner = Joiner.on("").skipNulls();
    ImmutableSet<String> s = ImmutableSet.of("ABCD", "CABD", "ACDB",
        "DACB", "BCDA", "ACBD", "ADCB", "CDAB", "DABC", "BCAD", "CADB",
        "CDBA", "CBAD", "ABDC", "ADBC", "BDCA", "DCBA", "BACD", "BADC",
        "BDAC", "CBDA", "DBCA", "DCAB");

    for (ArrayList<Character> cs : Utils.Permutations(Lists.newArrayList(
        'A', 'B', 'C', 'D')))
      if (!s.contains(joiner.join(cs)))
        System.out.println(joiner.join(cs));
  }
View Full Code Here

        }
    }

    @Before
    static void log() {
        Joiner joiner = Joiner.on(":").useForNull("");
        Logger.info(joiner.join(request.remoteAddress,
                                request.method,
                                request.secure ? "ssl" : "http",
                                SystemProperty.applicationVersion.get(),
                                SystemProperty.environment.get(),
                                session.get(SessionKeys.UID),
View Full Code Here

      while (keys.hasNext()) {
        String key = (String) keys.next();
        values.add(subset.getString(key));
      }
     
      Joiner joiner = Joiner.on(',').skipNulls();
      String result = joiner.join(values);
     
      if(Strings.isNullOrEmpty(result)){
        result = null;
      }
     
View Full Code Here

TOP

Related Classes of com.google.common.base.Joiner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.