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:dagger2.internal.codegen.SourceFileGenerationException.java

private static String createMessage(Iterable<ClassName> generatedClassNames, String message) {
    return String.format("Could not generate %s: %s.",
            Iterables.isEmpty(generatedClassNames) ? "unknown files" : Iterables.toString(generatedClassNames),
            message);/*  w  w  w  . ja v a  2s .c  om*/
}

From source file:com.flaptor.indextank.util.AbstractIterable.java

/**
 * Returns a string representation of this iterable. The string representation
 * consists of a list of the iterable's elements in the order they are
 * returned by its iterator, enclosed in square brackets ("[]"). Adjacent
 * elements are separated by the characters ", " (comma and space). Elements
 * are converted to strings as by {@link String#valueOf(Object)}.
 *///  ww w  .  j a v a2s  .  co m
@Override
public String toString() {
    return Iterables.toString(this);
}

From source file:eu.interedition.collatex.jung.JungVariantGraphTransposition.java

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

From source file:org.apache.hadoop.metrics2.impl.AbstractMetricsRecord.java

@Override
public String toString() {
    return Objects.toStringHelper(this).add("timestamp", timestamp()).add("name", name())
            .add("description", description()).add("tags", tags()).add("metrics", Iterables.toString(metrics()))
            .toString();/*  w  w  w . j av a2s  .  c  om*/
}

From source file:suneido.database.immudb.Indexes.java

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

From source file:clocker.docker.networking.entity.OpenStackVirtualNetworkImpl.java

public NetworkProvisioningExtension findNetworkProvisioner(Collection<? extends Location> locations) {
    Optional<? extends Location> found = Iterables.tryFind(locations, new Predicate<Location>() {
        @Override//from w w  w.  j a  va 2s .c om
        public boolean apply(Location input) {
            return input instanceof JcloudsLocation
                    && ((JcloudsLocation) input).getProvider().startsWith("openstack");
        }
    });
    if (!found.isPresent()) {
        throw new IllegalStateException(
                "Cannot find openstack location: " + Iterables.toString(getLocations()));
    }
    JcloudsLocation provisioner = (JcloudsLocation) found.get();
    NetworkProvisioningExtension extension = new OpenStackNetworkProvisioner(provisioner);
    return extension;
}

From source file:com.google.devtools.build.skyframe.TaggedEvents.java

/**
 * Returns <i>some</i> moderately sane representation of the events. Should never be used in
 * user-visible places, only for debugging and testing.
 *//*from  w ww.j av  a2s  . c o m*/
@Override
public String toString() {
    return tag == null ? "<unknown>" : tag + ": " + Iterables.toString(events);
}

From source file:eu.interedition.collatex.jung.JungVariantGraphEdge.java

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

From source file:brooklyn.location.docker.strategy.LabelPlacementStrategy.java

@Override
public boolean apply(DockerHostLocation input) {
    Set<String> labels = MutableSet.copyOf(config().get(LABELS));
    if (labels.isEmpty())
        return true;
    Set<String> tags = MutableSet
            .copyOf(Iterables.transform(input.getMachine().tags().getTags(), Functions.toStringFunction()));
    labels.removeAll(tags);//from   w  ww  . j av a  2s.  com
    LOG.debug("Host {} : Tags {} : Remaining {}", new Object[] { input, Iterables.toString(tags),
            labels.isEmpty() ? "none" : Iterables.toString(labels) });

    return labels.isEmpty();
}

From source file:de.faustedition.Server.java

@Override
public void run() {
    try {/*  w ww .  jav a2  s  . c om*/
        logger.info("Starting Faust-Edition with profiles "
                + Iterables.toString(Arrays.asList(environment.getActiveProfiles())));

        //scheduleTasks();
        startWebserver();

    } catch (Exception e) {
        e.printStackTrace();
        System.exit(1);
    }
}