List of usage examples for com.google.common.collect ImmutableMap.Builder putAll
public final void putAll(Map<? extends K, ? extends V> map)
From source file:org.sonar.server.settings.ChildSettings.java
/** * Only returns the currently loaded properties. * * <p>//from www .j a v a2 s.c o m * On the Web Server, global properties are loaded lazily when requested by name. Therefor, * this will return only global properties which have been requested using * {@link #get(String)} at least once prior to this call. */ @Override public Map<String, String> getProperties() { // order is important. local properties override parent properties. ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); builder.putAll(parentSettings.getProperties()); builder.putAll(localProperties); return builder.build(); }
From source file:io.appium.java_client.imagecomparison.FeaturesMatchingOptions.java
@Override public Map<String, Object> build() { final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.putAll(super.build()); ofNullable(detectorName).map(x -> builder.put("detectorName", x)); ofNullable(matchFunc).map(x -> builder.put("matchFunc", x)); ofNullable(goodMatchesFactor).map(x -> builder.put("goodMatchesFactor", x)); return builder.build(); }
From source file:io.appium.java_client.screenrecording.BaseStartScreenRecordingOptions.java
@Override public Map<String, Object> build() { final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.putAll(super.build()); ofNullable(timeLimit).map(x -> builder.put("timeLimit", x.getSeconds())); ofNullable(forceRestart).map(x -> builder.put("forceRestart", x)); return builder.build(); }
From source file:org.elasticsearch.search.lookup.LeafSearchLookup.java
public LeafSearchLookup(LeafReaderContext ctx, LeafDocLookup docMap, SourceLookup sourceLookup, LeafFieldsLookup fieldsLookup, LeafIndexLookup indexLookup, Map<String, Object> topLevelMap) { this.ctx = ctx; this.docMap = docMap; this.sourceLookup = sourceLookup; this.fieldsLookup = fieldsLookup; this.indexLookup = indexLookup; ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.putAll(topLevelMap); builder.put("doc", docMap); builder.put("_doc", docMap); builder.put("_source", sourceLookup); builder.put("_fields", fieldsLookup); builder.put("_index", indexLookup); asMap = builder.build();/*w ww .j av a2s. c o m*/ }
From source file:org.jclouds.trmk.vcloud_0_8.options.AddInternetServiceOptions.java
@Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) { ImmutableMap.Builder<String, Object> copy = ImmutableMap.builder(); copy.putAll(postParams); if (description != null) copy.put("description", description); copy.put("enabled", enabled); if (monitorEnabled != null) copy.put("monitor", monitorEnabled.toString()); return super.bindToRequest(request, copy.build()); }
From source file:org.androidtransfuse.analysis.AnalysisContext.java
private AnalysisContext(InjectionNode node, AnalysisContext previousContext, InjectionNodeBuilderRepository injectionNodeBuilders) { ImmutableMap.Builder<ASTType, InjectionNode> dependentsBuilder = ImmutableMap.builder(); dependentsBuilder.putAll(previousContext.dependents); if (!previousContext.dependents.containsKey(node.getASTType())) { //avoid adding duplicate keys (result of dependency loops) dependentsBuilder.put(node.getASTType(), node); }/*from w w w. ja v a 2 s . c om*/ this.dependents = dependentsBuilder.build(); this.injectionNodeBuilders = injectionNodeBuilders; }
From source file:com.facebook.presto.sql.planner.iterative.rule.MergeAdjacentWindows.java
@Override public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { if (!(node instanceof WindowNode)) { return Optional.empty(); }//from w w w. j a va2 s . c om WindowNode parent = (WindowNode) node; PlanNode source = lookup.resolve(parent.getSource()); if (!(source instanceof WindowNode)) { return Optional.empty(); } WindowNode child = (WindowNode) source; if (!child.getSpecification().equals(parent.getSpecification()) || dependsOn(parent, child)) { return Optional.empty(); } ImmutableMap.Builder<Symbol, WindowNode.Function> functionsBuilder = ImmutableMap.builder(); functionsBuilder.putAll(parent.getWindowFunctions()); functionsBuilder.putAll(child.getWindowFunctions()); return Optional.of(new WindowNode(parent.getId(), child.getSource(), parent.getSpecification(), functionsBuilder.build(), parent.getHashSymbol(), parent.getPrePartitionedInputs(), parent.getPreSortedOrderPrefix())); }
From source file:org.jclouds.vcloud.terremark.options.AddInternetServiceOptions.java
@Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, String> postParams) { ImmutableMap.Builder<String, String> copy = ImmutableMap.<String, String>builder(); copy.putAll(postParams); if (description != null) copy.put("description", description); copy.put("enabled", enabled); if (monitorEnabled != null) copy.put("monitor", monitorEnabled.toString()); return super.bindToRequest(request, copy.build()); }
From source file:io.appium.java_client.android.AndroidStartScreenRecordingOptions.java
@Override public Map<String, Object> build() { final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.putAll(super.build()); ofNullable(bitRate).map(x -> builder.put("bitRate", x)); ofNullable(videoSize).map(x -> builder.put("videoSize", x)); ofNullable(isBugReportEnabled).map(x -> builder.put("bugReport", x)); return builder.build(); }
From source file:com.helion3.safeguard.zones.ZonePermissions.java
/** * Get all flags and their boolean values. * * @return ImmutableMap<String, Boolean> *//* w w w . ja va 2s .c o m*/ public ImmutableMap<String, Boolean> getPermissions() { ImmutableMap.Builder<String, Boolean> builder = ImmutableMap.builder(); return builder.putAll(permissions).build(); }