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

The following examples show how to use com.google.common.collect.Iterables#toString() . 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 File: ScopeTest.java    From xtext-core with 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
Source File: ApiModelLoader.java    From raml-java-client-generator with Apache License 2.0 6 votes vote down vote up
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 File: AndroidLibraryTest.java    From bazel with 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 File: BatchRyaQuery.java    From rya with 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
Source File: KubernetesLocationYamlLiveTest.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
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 File: AndroidLibraryTest.java    From bazel with 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
Source File: ExternalLibraryBuilder.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
private String getProjectNames(Iterable<IN4JSProject> projects) {
	return Iterables.toString(from(projects).transform(p -> p.getProjectName()));
}
 
Example 8
Source File: ManualAssociationAwareWorkingSetManager.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public String toString() {
	return super.toString() + " " + Iterables.toString(projectNames);
}
 
Example 9
Source File: HttpHeaders.java    From styx with Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return Iterables.toString(nettyHeaders);
}
 
Example 10
Source File: DataValueLookupBuilderImpl.java    From morf with 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 File: RangeTest.java    From blueocean-plugin with MIT License 4 votes vote down vote up
private String toS(Iterable i) {
    return Iterables.toString(i);
}
 
Example 12
Source File: AbstractScope.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public String toString() {
	return Iterables.toString(this);
}
 
Example 13
Source File: CycleInfo.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
  return Iterables.toString(pathToCycle) + " -> " + Iterables.toString(cycle);
}
 
Example 14
Source File: EventCollector.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public synchronized String toString() {
  return "EventCollector: " + Iterables.toString(collected);
}
 
Example 15
Source File: ActionGraph.java    From buck with Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
  return Iterables.toString(nodes);
}
 
Example 16
Source File: Stack.java    From OpenModsLib with MIT License 4 votes vote down vote up
public String printContents() {
	return Iterables.toString(this);
}