Package com.google.common.base

Examples of com.google.common.base.Joiner.join()


            }
        }
        for (; k <= j; k++) {
            family.add(parts[k]);
        }
        return new HumanName(Strings.emptyToNull(joiner.join(prefixes)), joiner.join(given), joiner.join(family),
                Strings.emptyToNull(joiner.join(sufixes)));
    }

    /**
     * Normalizes the capitalization of the name components, does not change the current
View Full Code Here


        }
        for (; k <= j; k++) {
            family.add(parts[k]);
        }
        return new HumanName(Strings.emptyToNull(joiner.join(prefixes)), joiner.join(given), joiner.join(family),
                Strings.emptyToNull(joiner.join(sufixes)));
    }

    /**
     * Normalizes the capitalization of the name components, does not change the current
     *
 
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

    public static void main(String[] args) {
        String str = CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, "good-morning");
        System.out.println("lower camel => " + str);

        Joiner joiner = Joiner.on("; ").useForNull("null");
        str = joiner.join("nice", "talk", null, "name");
        System.out.println("join on ';' => " + str);
    }

}
View Full Code Here

        ImmutableMultiset<?> actualSet = ImmutableMultiset.copyOf(actual);
        ImmutableMultiset<?> expectedSet = ImmutableMultiset.copyOf(expected);
        if (!actualSet.equals(expectedSet)) {
            Joiner joiner = Joiner.on("\n      ");
            fail("%sexpected: collections to be equal (ignoring order).%nActual:%n      %s%nExpected:%n      %s", toMessageString(message), joiner.join(actual), joiner.join(expected));
        }
    }

    private static String toMessageString(String message)
    {
View Full Code Here

        ImmutableMultiset<?> actualSet = ImmutableMultiset.copyOf(actual);
        ImmutableMultiset<?> expectedSet = ImmutableMultiset.copyOf(expected);
        if (!actualSet.equals(expectedSet)) {
            Joiner joiner = Joiner.on("\n      ");
            fail("%sexpected: collections to be equal (ignoring order).%nActual:%n      %s%nExpected:%n      %s", toMessageString(message), joiner.join(actual), joiner.join(expected));
        }
    }

    private static String toMessageString(String message)
    {
View Full Code Here

    }

    @Override
    public String toString() {
      Joiner join = Joiner.on('.');
      return "ExpressionKeys: " + join.join(keyFields);
    }
  }
 
  private static String[] removeDuplicates(String[] in) {
    List<String> ret = new LinkedList<String>();
View Full Code Here

    joined = Joiner.on(", ").skipNulls().appendTo(sb, fantasyGenres).toString();
    assertThat(joined).isEqualTo("Append StringBulder demo: Space Opera, Horror, Magic realism, Religion");

    // reuse joiner
    Joiner joiner = Joiner.on(", ");
    joiner.join(fantasyGenres);
    joiner.join(fantasyGenres2);

  }

  /**
 
View Full Code Here

    assertThat(joined).isEqualTo("Append StringBulder demo: Space Opera, Horror, Magic realism, Religion");

    // reuse joiner
    Joiner joiner = Joiner.on(", ");
    joiner.join(fantasyGenres);
    joiner.join(fantasyGenres2);

  }

  /**
   * Splitter有很多函数与Joiner一样,不一一演示
 
View Full Code Here

        ImmutableMultiset<?> actualSet = ImmutableMultiset.copyOf(actual);
        ImmutableMultiset<?> expectedSet = ImmutableMultiset.copyOf(expected);
        if (!actualSet.equals(expectedSet)) {
            Joiner joiner = Joiner.on("\n      ");
            fail("%sexpected: collections to be equal (ignoring order).%nActual:%n      %s%nExpected:%n      %s", toMessageString(message), joiner.join(actual), joiner.join(expected));
        }
    }

    private static String toMessageString(String message)
    {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.