当前位置: 首页>>代码示例>>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;未经允许,请勿转载。