@Override public String toString() { return "Predicates.and(" + COMMA_JOINER.join(components) + ")"; }
/** * Returns a joiner which automatically places {@code separator} between consecutive elements. */ @CheckReturnValue public static Joiner on(String separator) { return new Joiner(separator); }
/** * Appends to {@code builder} the string representation of each of the remaining arguments. * Identical to {@link #appendTo(Appendable, Object, Object, Object...)}, except that it does not * throw {@link IOException}. */ public final StringBuilder appendTo( StringBuilder builder, @Nullable Object first, @Nullable Object second, Object... rest) { return appendTo(builder, iterable(first, second, rest)); }
/** * Appends the string representation of each of {@code parts}, using the previously configured * separator between each, to {@code appendable}. */ public final <A extends Appendable> A appendTo(A appendable, Object[] parts) throws IOException { return appendTo(appendable, Arrays.asList(parts)); }
@Override CharSequence toString(@Nullable Object part) { return (part == null) ? nullText : Joiner.this.toString(part); }
/** Returns the args. */ protected List<String> toArgList() { List<String> argList = new ArrayList<>(args.size() * 2); args.asMap().forEach((key, values) -> { argList.add("-" + key); boolean valuesIsEmptyString = values.size() == 1 && Iterables.getOnlyElement(values).isEmpty(); if (!valuesIsEmptyString) { argList.add(Joiner.on(",").join(values)); } }); return argList; }
/** * Appends the string representation of each of {@code parts}, using the previously configured * separator between each, to {@code appendable}. */ public <A extends Appendable> A appendTo(A appendable, Iterable<?> parts) throws IOException { return appendTo(appendable, parts.iterator()); }
/** * Appends to {@code appendable} the string representation of each of the remaining arguments. */ public final <A extends Appendable> A appendTo( A appendable, @Nullable Object first, @Nullable Object second, Object... rest) throws IOException { return appendTo(appendable, iterable(first, second, rest)); }
/** * Appends the string representation of each of {@code parts}, using the previously configured * separator between each, to {@code appendable}. * * @since 11.0 */ public <A extends Appendable> A appendTo(A appendable, Iterator<?> parts) throws IOException { checkNotNull(appendable); if (parts.hasNext()) { appendable.append(toString(parts.next())); while (parts.hasNext()) { appendable.append(separator); appendable.append(toString(parts.next())); } } return appendable; }
private Map<String, String> defaultSystemProperties() { Map<String, String> map = new HashMap<>(); map.put("osgi.framework.useSystemProperties", "false"); map.put(EclipseStarter.PROP_INSTALL_AREA, installationRoot.getAbsolutePath()); map.put(EclipseStarter.PROP_NOSHUTDOWN, "false"); // enable map.put("equinox.use.ds", "true"); map.put(EclipseStarter.PROP_BUNDLES, Joiner.on(", ").join( // automatic bundle discovery and installation "org.eclipse.equinox.common@2:start", "org.eclipse.update.configurator@3:start", // support eclipse's -application argument "org.eclipse.core.runtime@4:start", // declarative services "org.eclipse.equinox.ds@5:start")); map.put(EclipseStarter.PROP_FRAMEWORK, getPluginRequireSingle("org.eclipse.osgi").toURI().toString()); return map; }
@Override public String toString() { return "Predicates.or(" + COMMA_JOINER.join(components) + ")"; }
/** * Appends the string representation of each of {@code parts}, using the previously configured * separator between each, to {@code builder}. Identical to {@link #appendTo(Appendable, * Iterable)}, except that it does not throw {@link IOException}. */ public final StringBuilder appendTo(StringBuilder builder, Iterable<?> parts) { return appendTo(builder, parts.iterator()); }
/** * Appends the string representation of each entry in {@code entries}, using the previously * configured separator and key-value separator, to {@code appendable}. * * @since 11.0 */ @Beta public <A extends Appendable> A appendTo(A appendable, Iterator<? extends Entry<?, ?>> parts) throws IOException { checkNotNull(appendable); if (parts.hasNext()) { Entry<?, ?> entry = parts.next(); appendable.append(joiner.toString(entry.getKey())); appendable.append(keyValueSeparator); appendable.append(joiner.toString(entry.getValue())); while (parts.hasNext()) { appendable.append(joiner.separator); Entry<?, ?> e = parts.next(); appendable.append(joiner.toString(e.getKey())); appendable.append(keyValueSeparator); appendable.append(joiner.toString(e.getValue())); } } return appendable; }
/** * Returns a joiner which automatically places {@code separator} between consecutive elements. */ @CheckReturnValue public static Joiner on(char separator) { return new Joiner(String.valueOf(separator)); }
/** * Writes out the entire state of this argsbuilder * to a string. This can be used to determine if * the arguments have changed at all, to aid in staleness checking. * * If you extend EclipseArgsBuilder and add any kinds of * new state (e.g. EclipseAntArgsBuilder), then you * *must* override this method and embed all * internal state within it. */ public String completeState() { StringBuilder builder = new StringBuilder(); args.asMap().forEach((key, values) -> { builder.append("-" + key); boolean valuesIsEmptyString = values.size() == 1 && Iterables.getOnlyElement(values).isEmpty(); if (!valuesIsEmptyString) { builder.append(' '); builder.append(Joiner.on(",").join(values)); } builder.append('\n'); }); return builder.toString(); }
/** * Returns a string containing the string representation of each of {@code parts}, using the * previously configured separator between each. */ @CheckReturnValue public final String join(Object[] parts) { return join(Arrays.asList(parts)); }
/** * Appends the string representation of each of {@code parts}, using the previously configured * separator between each, to {@code builder}. Identical to {@link #appendTo(Appendable, * Iterable)}, except that it does not throw {@link IOException}. */ public final StringBuilder appendTo(StringBuilder builder, Object[] parts) { return appendTo(builder, Arrays.asList(parts)); }