Example usage for com.google.common.collect Iterables toString

List of usage examples for com.google.common.collect Iterables toString

Introduction

In this page you can find the example usage for com.google.common.collect Iterables toString.

Prototype

public static String toString(Iterable<?> iterable) 

Source Link

Document

Returns a string representation of iterable , with the format [e1, e2, ..., en] (that is, identical to java.util.Arrays Arrays .toString(Iterables.toArray(iterable)) ).

Usage

From source file:gobblin.util.commit.DeleteFileCommitStep.java

@Override
public String toString() {
    return String.format("Delete the following files at %s: %s", this.fsUri,
            Iterables.toString(Iterables.transform(this.pathsToDelete, new Function<FileStatus, Path>() {
                @Nullable//from www .  j a  va 2  s .c o m
                @Override
                public Path apply(@Nullable FileStatus input) {
                    return input != null ? input.getPath() : null;
                }
            })));
}

From source file:org.impressivecode.depress.mg.po.PeopleOrganizationMetricsNodeModel.java

private void configureDevDataSpec(final DataTableSpec dataTableSpec) throws InvalidSettingsException {
    Set<String> missing = findMissingColumnSubset(dataTableSpec, createDevDataColumnSpec());
    if (!missing.isEmpty()) {
        throw new InvalidSettingsException("Developers data table does not contain required column.  Missing: "
                + Iterables.toString(missing));
    } else {/*from  w  w  w  .ja v a2  s. c o  m*/
        this.developersDataSpec = dataTableSpec;
    }
}

From source file:au.edu.uq.nmerge.graph.VariantGraphArc.java

/**
 * Convert an Arc to a String for printing out
 *
 * @return the arc as a string//  ww  w.  j a va 2 s  .  c o  m
 */
public String toString() {
    try {
        StringBuffer sb = new StringBuffer();
        if (from == null) {
            sb.append("(0)");
        } else if (from.isIncomingEmpty()) {
            sb.append("(s)");
        } else {
            sb.append("(" + from.nodeId + ")");
        }
        sb.append(Iterables.toString(versions));
        sb.append(": ");
        if (parent != null) {
            sb.append("[" + parent.id + ":");
        } else if (children != null) {
            sb.append("{" + id + ":");
        }
        sb.append(Iterables.toString(getData()));
        if (parent != null) {
            sb.append("]");
        } else if (children != null) {
            sb.append("}");
        }
        if (to == null) {
            sb.append("(0)");
        } else if (to.isOutgoingEmpty()) {
            sb.append("(e)");
        } else {
            sb.append("(" + to.nodeId + ")");
        }
        return sb.toString();
    } catch (Exception e) {
        Errors.LOG.error(e.getMessage(), e);
        return "";
    }
}

From source file:org.immutables.sequence.Sequence.java

/**
 * Returns a string representation of this fluent iterable, with the format
 * {@code [e1, e2, ..., en]}./*from ww  w.j  a  v  a  2s.c o m*/
 * @return the string
 */
@Override
public String toString() {
    return Iterables.toString(iterable);
}

From source file:com.google.errorprone.refaster.Choice.java

@Override
public String toString() {
    return Iterables.toString(asIterable());
}

From source file:eu.interedition.collatex.nmerge.mvd.ChunkStateSet.java

/**
 * Convert these states to a string for incorporation into a chunk
 *
 * @return the state set as a string//from  w ww . j a va 2  s.  com
 */
public String toString() {
    return (states == null ? "" : Iterables.toString(Arrays.asList(states)));
}

From source file:hudson.util.RunList.java

/**
 * Returns the first streak of the elements that satisfy the given predicate.
 *
 * For example, {@code filter([1,2,3,4],odd)==[1,3]} but {@code limit([1,2,3,4],odd)==[1]}.
 *//*from   w  w  w  .j  av a2 s .  co  m*/
private RunList<R> limit(final CountingPredicate<R> predicate) {
    size = null;
    first = null;
    final Iterable<R> nested = base;
    base = new Iterable<R>() {
        public Iterator<R> iterator() {
            return hudson.util.Iterators.limit(nested.iterator(), predicate);
        }

        @Override
        public String toString() {
            return Iterables.toString(this);
        }
    };
    return this;
}

From source file:org.opendaylight.yangtools.yang.binding.InstanceIdentifier.java

/**
 * Add class-specific toString attributes.
 *
 * @param toStringHelper ToStringHelper instance
 * @return ToStringHelper instance which was passed in
 *//*from   w  w w .j  av a2  s  .  co  m*/
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
    return toStringHelper.add("targetType", targetType).add("path", Iterables.toString(pathArguments));
}

From source file:com.cloudera.impala.catalog.KuduTable.java

/**
 * Load the columns from the schema list
 *///from  w ww  .  j a va 2s.c o  m
private void loadColumns(List<FieldSchema> schema, HiveMetaStoreClient client, Set<String> keyColumns)
        throws TableLoadingException {

    if (keyColumns.size() == 0 || keyColumns.size() > schema.size()) {
        throw new TableLoadingException(String.format("Kudu tables must have at least one"
                + "key column (had %d), and no more key columns than there are table columns " + "(had %d).",
                keyColumns.size(), schema.size()));
    }

    clearColumns();
    Set<String> columnNames = Sets.newHashSet();
    int pos = 0;
    for (FieldSchema field : schema) {
        com.cloudera.impala.catalog.Type type = parseColumnType(field);
        // TODO(kudu-merge): Check for decimal types?
        boolean isKey = keyColumns.contains(field.getName());
        KuduColumn col = new KuduColumn(field.getName(), isKey, !isKey, type, field.getComment(), pos);
        columnNames.add(col.getName());
        addColumn(col);
        ++pos;
    }

    if (!columnNames.containsAll(keyColumns)) {
        throw new TableLoadingException(String.format(
                "Some key columns were not found in"
                        + " the set of columns. List of column names: %s, List of key column names:" + " %s",
                Iterables.toString(columnNames), Iterables.toString(keyColumns)));
    }

    kuduKeyColumnNames_ = ImmutableList.copyOf(keyColumns);

    loadAllColumnStats(client);
}

From source file:com.palantir.common.collect.IterableView.java

@Override
public String toString() {
    return Iterables.toString(delegate());
}