當前位置: 首頁>>代碼示例>>Java>>正文


Java Multimap.values方法代碼示例

本文整理匯總了Java中com.google.common.collect.Multimap.values方法的典型用法代碼示例。如果您正苦於以下問題:Java Multimap.values方法的具體用法?Java Multimap.values怎麽用?Java Multimap.values使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.collect.Multimap的用法示例。


在下文中一共展示了Multimap.values方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: determineManagedPropertyType

import com.google.common.collect.Multimap; //導入方法依賴的package包/類
private static ModelType<?> determineManagedPropertyType(StructBindingExtractionContext<?> extractionContext, String propertyName, Multimap<PropertyAccessorType, StructMethodBinding> accessorBindings) {
    Collection<StructMethodBinding> isGetter = accessorBindings.get(IS_GETTER);
    for (StructMethodBinding isGetterBinding : isGetter) {
        if (!((ManagedPropertyMethodBinding) isGetterBinding).getDeclaredPropertyType().equals(ModelType.of(Boolean.TYPE))) {
            WeaklyTypeReferencingMethod<?, ?> isGetterMethod = isGetterBinding.getViewMethod();
            extractionContext.add(isGetterMethod, String.format("it should either return 'boolean', or its name should be '%s()'",
                "get" + isGetterMethod.getName().substring(2)));
        }
    }
    Set<ModelType<?>> potentialPropertyTypes = Sets.newLinkedHashSet();
    for (StructMethodBinding binding : accessorBindings.values()) {
        if (binding.getAccessorType() == SETTER) {
            continue;
        }
        ManagedPropertyMethodBinding propertyBinding = (ManagedPropertyMethodBinding) binding;
        potentialPropertyTypes.add(propertyBinding.getDeclaredPropertyType());
    }
    Collection<ModelType<?>> convergingPropertyTypes = findConvergingTypes(potentialPropertyTypes);
    if (convergingPropertyTypes.size() != 1) {
        extractionContext.add(propertyName, String.format("it must have a consistent type, but it's defined as %s",
            Joiner.on(", ").join(ModelTypes.getDisplayNames(convergingPropertyTypes))));
        return convergingPropertyTypes.iterator().next();
    }
    ModelType<?> propertyType = Iterables.getOnlyElement(convergingPropertyTypes);

    for (StructMethodBinding setterBinding : accessorBindings.get(SETTER)) {
        ManagedPropertyMethodBinding propertySetterBinding = (ManagedPropertyMethodBinding) setterBinding;
        ModelType<?> declaredSetterType = propertySetterBinding.getDeclaredPropertyType();
        if (!declaredSetterType.equals(propertyType)) {
            extractionContext.add(setterBinding.getViewMethod(), String.format("it should take parameter with type '%s'",
                propertyType.getDisplayName()));
        }
    }
    return propertyType;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:36,代碼來源:DefaultStructBindingsStore.java

示例2: extractRepoFileDependencies

import com.google.common.collect.Multimap; //導入方法依賴的package包/類
public Collection<IdeExtendedRepoFileDependency> extractRepoFileDependencies(DependencyHandler dependencyHandler, Collection<Configuration> plusConfigurations, Collection<Configuration> minusConfigurations, boolean downloadSources, boolean downloadJavadoc) {
    // can have multiple IDE dependencies with same component identifier (see GRADLE-1622)
    Multimap<ComponentIdentifier, IdeExtendedRepoFileDependency> resolvedDependenciesComponentMap = LinkedHashMultimap.create();
    for (IdeExtendedRepoFileDependency dep : resolvedExternalDependencies(plusConfigurations, minusConfigurations)) {
        resolvedDependenciesComponentMap.put(toComponentIdentifier(dep.getId()), dep);
    }

    List<Class<? extends Artifact>> artifactTypes = new ArrayList<Class<? extends Artifact>>(2);
    if (downloadSources) {
        artifactTypes.add(SourcesArtifact.class);
    }

    if (downloadJavadoc) {
        artifactTypes.add(JavadocArtifact.class);
    }

    downloadAuxiliaryArtifacts(dependencyHandler, resolvedDependenciesComponentMap, artifactTypes);

    Collection<UnresolvedIdeRepoFileDependency> unresolvedDependencies = unresolvedExternalDependencies(plusConfigurations, minusConfigurations);
    Collection<IdeExtendedRepoFileDependency> resolvedDependencies = resolvedDependenciesComponentMap.values();

    Collection<IdeExtendedRepoFileDependency> resolvedAndUnresolved = new ArrayList<IdeExtendedRepoFileDependency>(unresolvedDependencies.size() + resolvedDependencies.size());
    resolvedAndUnresolved.addAll(resolvedDependencies);
    resolvedAndUnresolved.addAll(unresolvedDependencies);

    return resolvedAndUnresolved;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:28,代碼來源:IdeDependenciesExtractor.java

示例3: invokeInternal

import com.google.common.collect.Multimap; //導入方法依賴的package包/類
@Override
protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor,
		Issues issues) {
	ResourceSet resourceSet = getResourceSet();

	// due to some Xcore peculiarity we have to access the IAllContainerState here
	// to trigger some lazy init logic
	IAllContainersState allContainerState = (IAllContainersState) EcoreUtil.getAdapter(resourceSet.eAdapters(),
			IAllContainersState.class);
	allContainerState.isEmpty("");

	Multimap<String, URI> uris = getPathTraverser().resolvePathes(pathes,
			new Predicate<URI>() {
		@Override
		public boolean apply(URI input) {
			return input.fileExtension().equals(XCORE_FILE_EXT);
		}
	});
	List<Resource> resources = new ArrayList<>();
	for (URI uri : uris.values()) {
		LOGGER.info(uri);
		try {
			resources.add(parse(uri, resourceSet));
		} catch (Exception e) {
			LOGGER.error("Problem during loading of resource @ " + uri, e);
		}
	}
	installIndex(resourceSet);
	for (Resource r : resources) {
		EcoreUtil.resolveAll(r);
		for (Diagnostic x : r.getErrors()) {
			issues.addError(x.getMessage(), x);
		}

	}
	ctx.set(slot, resources);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:38,代碼來源:XcoreReader.java

示例4: assertWatchKeys

import com.google.common.collect.Multimap; //導入方法依賴的package包/類
private void assertWatchKeys(Multimap<String, String> watchKeysMap, DeferredResult deferredResult) {
  for (String watchKey : watchKeysMap.values()) {
    Collection<DeferredResultWrapper> deferredResultWrappers = deferredResults.get(watchKey);
    boolean found = false;
    for (DeferredResultWrapper wrapper: deferredResultWrappers) {
      if (Objects.equals(wrapper.getResult(), deferredResult)) {
        found = true;
      }
    }
    assertTrue(found);
  }
}
 
開發者ID:dewey-its,項目名稱:apollo-custom,代碼行數:13,代碼來源:NotificationControllerV2Test.java

示例5: getGwtTestCaseClassNames

import com.google.common.collect.Multimap; //導入方法依賴的package包/類
private static Collection<String> getGwtTestCaseClassNames(final Reflections reflections) {
    Store store = reflections.getStore();
    Multimap<String, String> multimap = store.get(GwtTestCaseScanner.class);
    return multimap.values();
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:6,代碼來源:GWTTestCaseSuite.java

示例6: Context

import com.google.common.collect.Multimap; //導入方法依賴的package包/類
private Context(Multimap<AnalyzedRelation, Symbol> outputs, Collection<Field> canBeFetched) {
    this.canBeFetched = canBeFetched;
    this.skipSymbols = outputs.values();
    this.outputs = outputs;
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:6,代碼來源:FetchFieldExtractor.java


注:本文中的com.google.common.collect.Multimap.values方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。