本文整理匯總了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);
}