Java Code Examples for com.google.common.collect.Iterables#toString()

The following examples show how to use com.google.common.collect.Iterables#toString() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: xtext-core   File: ScopeTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected Iterable<IEObjectDescription> getAllLocalElements() {
	return new Iterable<IEObjectDescription>() {
		@Override
		public Iterator<IEObjectDescription> iterator() {
			numberOfCalls++;
			return singleton(
					(IEObjectDescription) new EObjectDescription(QualifiedName.create(name),
							EcorePackage.Literals.EATTRIBUTE, null)).iterator();
		}

		@Override
		public String toString() {
			try {
				return Iterables.toString(this);
			} finally {
				numberOfCalls--;
			}
		}
	};
}
 
Example 2
private static ApiModel wrapApiModel(RamlModelResult ramlModelResult) throws RuntimeException
{
    if (ramlModelResult.hasErrors())
    {
        throw new RuntimeException("Invalid RAML descriptor " + Iterables.toString(transform(ramlModelResult.getValidationResults(), new Function<ValidationResult, String>()
        {
            @Nullable
            @Override
            public String apply(ValidationResult input)
            {
                return input.getMessage();
            }
        })));
    }
    if (ramlModelResult.isVersion08())
    {
        return new ApiModelImpl(ramlModelResult.getApiV08());
    }
    else
    {
        return new org.mule.raml.impl.v10.model.ApiModelImpl(ramlModelResult.getApiV10());
    }
}
 
Example 3
Source Project: bazel   File: AndroidLibraryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testAndroidJavacoptsCanBeOverridden() throws Exception {
  scratch.file(
      "java/android/BUILD",
      "android_library(",
      "    name = 'a',",
      "    srcs = ['A.java'],",
      "    javacopts = ['-g:lines,source'],",
      ")");

  JavaCompileAction javacAction =
      (JavaCompileAction) getGeneratingActionForLabel("//java/android:liba.jar");

  String commandLine = Iterables.toString(getJavacArguments(javacAction));
  assertThat(commandLine).contains("-g:lines,source");
}
 
Example 4
Source Project: rya   File: BatchRyaQuery.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return "BatchRyaQuery{" +
            "queries=" + Iterables.toString(queries) +
            "options={" + super.toString() +
            '}' +
            '}';
}
 
Example 5
public KubernetesClient getClient(Entity entity) {
    MachineProvisioningLocation location = entity.sensors().get(SoftwareProcess.PROVISIONING_LOCATION);
    if (location instanceof KubernetesLocation) {
        KubernetesLocation kubernetes = (KubernetesLocation) location;
        ConfigBag config = kubernetes.config().getBag();
        KubernetesClientRegistry registry = kubernetes.config().get(KubernetesLocationConfig.KUBERNETES_CLIENT_REGISTRY);
        KubernetesClient client = registry.getKubernetesClient(config);
        return client;
    }
    throw new IllegalStateException("Cannot find KubernetesLocation on entity: " + Iterables.toString(entity.getLocations()));
}
 
Example 6
Source Project: bazel   File: AndroidLibraryTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testCommandLineContainsTargetLabelAndRuleKind() throws Exception {
  scratch.file("java/android/BUILD", "android_library(name = 'a', srcs = ['A.java'])");
  JavaCompileAction javacAction =
      (JavaCompileAction) getGeneratingActionForLabel("//java/android:liba.jar");

  String commandLine = Iterables.toString(getJavacArguments(javacAction));
  assertThat(commandLine).contains("--target_label, //java/android:a");
}
 
Example 7
private String getProjectNames(Iterable<IN4JSProject> projects) {
	return Iterables.toString(from(projects).transform(p -> p.getProjectName()));
}
 
Example 8
@Override
public String toString() {
	return super.toString() + " " + Iterables.toString(projectNames);
}
 
Example 9
Source Project: styx   File: HttpHeaders.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return Iterables.toString(nettyHeaders);
}
 
Example 10
Source Project: morf   File: DataValueLookupBuilderImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
  if (data == null) return "{}";
  return Iterables.toString(getValues());
}
 
Example 11
Source Project: blueocean-plugin   File: RangeTest.java    License: MIT License 4 votes vote down vote up
private String toS(Iterable i) {
    return Iterables.toString(i);
}
 
Example 12
@Override
public String toString() {
	return Iterables.toString(this);
}
 
Example 13
Source Project: bazel   File: CycleInfo.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
  return Iterables.toString(pathToCycle) + " -> " + Iterables.toString(cycle);
}
 
Example 14
Source Project: bazel   File: EventCollector.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public synchronized String toString() {
  return "EventCollector: " + Iterables.toString(collected);
}
 
Example 15
Source Project: buck   File: ActionGraph.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
  return Iterables.toString(nodes);
}
 
Example 16
Source Project: OpenModsLib   File: Stack.java    License: MIT License 4 votes vote down vote up
public String printContents() {
	return Iterables.toString(this);
}