本文整理汇总了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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例5: BaseTypeImpl
import com.google.common.collect.ImmutableListMultimap; //导入方法依赖的package包/类
BaseTypeImpl(Multimap<String, ValueType> properties) {
this.properties = ImmutableListMultimap.copyOf(properties);
}