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


Java ImmutableListMultimap.copyOf方法代碼示例

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


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

示例1: build

import com.google.common.collect.ImmutableListMultimap; //導入方法依賴的package包/類
ProtoRegistry build() {
  ImmutableListMultimap<String, TypeModification> modificationsMap =
      ImmutableListMultimap.copyOf(
          this.typeModifications
              .stream()
              .map(
                  modification ->
                      new SimpleImmutableEntry<>(modification.getTypeName(), modification))
              .collect(Collectors.toList()));

  final BiMap<String, GraphQLType> mapping = HashBiMap.create();

  GraphQLInterfaceType nodeInterface =
      new Relay()
          .nodeInterface(
              env -> {
                Relay.ResolvedGlobalId resolvedGlobalId =
                    new Relay().fromGlobalId(env.getArguments().get("id").toString());
                return (GraphQLObjectType) mapping.get(resolvedGlobalId.getType());
              });

  mapping.putAll(
      modifyTypes(
          getMap(fileDescriptors, descriptors, enumDescriptors, nodeInterface),
          modificationsMap));

  return new ProtoRegistry(mapping, nodeInterface);
}
 
開發者ID:google,項目名稱:rejoiner,代碼行數:29,代碼來源:ProtoRegistry.java

示例2: SingularityDeployStatistics

import com.google.common.collect.ImmutableListMultimap; //導入方法依賴的package包/類
@JsonCreator
public SingularityDeployStatistics(@JsonProperty("requestId") String requestId, @JsonProperty("deployId") String deployId, @JsonProperty("numSuccess") int numSuccess, @JsonProperty("numFailures") int numFailures,
    @JsonProperty("numSequentialRetries") int numSequentialRetries, @JsonProperty("lastFinishAt") Optional<Long> lastFinishAt, @JsonProperty("lastTaskState") Optional<ExtendedTaskState> lastTaskState,
    @JsonProperty("instanceSequentialFailureTimestamps") ListMultimap<Integer, Long> instanceSequentialFailureTimestamps, @JsonProperty("numTasks") int numTasks, @JsonProperty("averageRuntimeMillis")  Optional<Long> averageRuntimeMillis) {
  this.requestId = requestId;
  this.deployId = deployId;
  this.numSuccess = numSuccess;
  this.numFailures = numFailures;
  this.lastFinishAt = lastFinishAt;
  this.lastTaskState = lastTaskState;
  this.numSequentialRetries = numSequentialRetries;
  this.numTasks = numTasks;
  this.averageRuntimeMillis = averageRuntimeMillis;
  this.instanceSequentialFailureTimestamps = instanceSequentialFailureTimestamps == null ?  ImmutableListMultimap.<Integer, Long> of() : ImmutableListMultimap.copyOf(instanceSequentialFailureTimestamps);
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:16,代碼來源:SingularityDeployStatistics.java

示例3: loadMeta

import com.google.common.collect.ImmutableListMultimap; //導入方法依賴的package包/類
public void loadMeta(MetaAccumulator meta) {
    this.lock.writeLock().lock();
    try {
        this.metaMultimap = ImmutableListMultimap.copyOf(meta.getMeta());

        //noinspection unchecked
        Map<String, List<String>> metaMap = (Map) this.metaMultimap.asMap();
        ImmutableMap.Builder<String, String> metaMapBuilder = ImmutableMap.builder();

        for (Map.Entry<String, List<String>> e : metaMap.entrySet()) {
            if (e.getValue().isEmpty()) {
                continue;
            }

            // take the value which was accumulated first
            metaMapBuilder.put(e.getKey(), e.getValue().get(0));
        }
        this.meta = metaMapBuilder.build();

        this.prefixes = ImmutableSortedMap.copyOfSorted(meta.getPrefixes());
        this.suffixes = ImmutableSortedMap.copyOfSorted(meta.getSuffixes());
        this.prefixStack = meta.getPrefixStack();
        this.suffixStack = meta.getSuffixStack();
    } finally {
        this.lock.writeLock().unlock();
    }
}
 
開發者ID:lucko,項目名稱:LuckPerms,代碼行數:28,代碼來源:MetaCache.java

示例4: SchemaOrgTypeImpl

import com.google.common.collect.ImmutableListMultimap; //導入方法依賴的package包/類
public SchemaOrgTypeImpl(
    Multimap<String, ValueType> properties, Multimap<String, Thing> reverseMap) {
  super(properties);
  this.reverseMap = ImmutableListMultimap.copyOf(reverseMap);
}
 
開發者ID:google,項目名稱:schemaorg-java,代碼行數:6,代碼來源:SchemaOrgTypeImpl.java

示例5: BaseTypeImpl

import com.google.common.collect.ImmutableListMultimap; //導入方法依賴的package包/類
BaseTypeImpl(Multimap<String, ValueType> properties) {
  this.properties = ImmutableListMultimap.copyOf(properties);
}
 
開發者ID:google,項目名稱:schemaorg-java,代碼行數:4,代碼來源:BaseTypeImpl.java


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