Example usage for com.google.common.collect ArrayListMultimap create

List of usage examples for com.google.common.collect ArrayListMultimap create

Introduction

In this page you can find the example usage for com.google.common.collect ArrayListMultimap create.

Prototype

public static <K, V> ArrayListMultimap<K, V> create(Multimap<? extends K, ? extends V> multimap) 

Source Link

Document

Constructs an ArrayListMultimap with the same mappings as the specified multimap.

Usage

From source file:com.facebook.presto.sql.planner.assertions.ExpressionAliases.java

public ExpressionAliases(ExpressionAliases expressionAliases) {
    requireNonNull(expressionAliases, "symbolAliases are null");
    this.map = ArrayListMultimap.create(expressionAliases.map);
}

From source file:org.cloudsmith.geppetto.validation.runner.ValidationAllContainersState.java

public void configure(List<String> containers, Multimap<String, URI> container2Uris,
        Multimap<String, String> restrictedVisibility) {
    super.configure(containers, container2Uris);
    this.restricted = ArrayListMultimap.create(restrictedVisibility);
}

From source file:org.apache.brooklyn.util.http.executor.HttpRequestImpl.java

protected HttpRequestImpl(HttpRequest.Builder builder) {
    this.uri = checkNotNull(builder.uri, "uri");
    this.method = checkNotNull(builder.method, "method");
    this.body = builder.body;
    this.headers = Multimaps
            .unmodifiableMultimap(ArrayListMultimap.create(checkNotNull(builder.headers, "headers")));
    this.credentials = builder.credentials;
    this.config = builder.config;
}

From source file:org.eclipse.viatra.query.patternlanguage.emf.util.AdvancedPatternParsingResults.java

public Multimap<URI, IQuerySpecification> getUriMap() {
    return ArrayListMultimap.create(uriMap);
}

From source file:eu.esdihumboldt.hale.common.align.model.functions.join.JoinMigrator.java

@Override
public MutableCell updateCell(Cell originalCell, AlignmentMigration migration, MigrationOptions options,
        SimpleLog log) {//from   ww  w. ja  va  2 s .c o m
    MutableCell result = super.updateCell(originalCell, migration, options, log);
    SimpleLog cellLog = SimpleLog.all(log, new CellLog(result, CELL_LOG_CATEGORY));

    if (options.updateSource()) {
        ListMultimap<String, ParameterValue> modParams = ArrayListMultimap
                .create(result.getTransformationParameters());
        List<ParameterValue> joinParams = modParams.get(JoinFunction.PARAMETER_JOIN);
        if (!joinParams.isEmpty()) {
            JoinParameter joinParam = joinParams.get(0).as(JoinParameter.class);
            if (joinParam != null) {
                joinParams.clear();
                joinParams.add(new ParameterValue(
                        Value.complex(convertJoinParameter(joinParam, migration, options, cellLog))));
            }
        }
        result.setTransformationParameters(modParams);
    }

    return result;
}

From source file:eu.esdihumboldt.hale.common.align.model.functions.FormattedStringMigrator.java

@Override
public MutableCell updateCell(Cell originalCell, AlignmentMigration migration, MigrationOptions options,
        SimpleLog log) {//from  w  w w.  j  ava 2 s  . c o  m
    MutableCell result = super.updateCell(originalCell, migration, options, log);
    log = SimpleLog.all(log, new CellLog(result, CELL_LOG_CATEGORY));

    if (options.updateSource()) {
        ListMultimap<String, ParameterValue> modParams = ArrayListMultimap
                .create(result.getTransformationParameters());
        List<ParameterValue> patternParams = modParams.get(FormattedStringFunction.PARAMETER_PATTERN);
        if (!patternParams.isEmpty()) {
            String pattern = patternParams.get(0).as(String.class);
            if (pattern != null) {
                patternParams.clear();
                patternParams.add(new ParameterValue(
                        Value.of(convertPattern(pattern, originalCell.getSource(), migration, log))));
            }
        }
        result.setTransformationParameters(modParams);
    }

    return result;
}

From source file:org.apache.brooklyn.util.http.executor.HttpRequestImpl.java

public HttpRequestImpl(HttpRequestImpl httpRequest) {
    this.uri = checkNotNull(httpRequest.uri, "uri");
    this.method = checkNotNull(httpRequest.method, "method");
    this.body = httpRequest.body;
    this.headers = Multimaps
            .unmodifiableMultimap(ArrayListMultimap.create(checkNotNull(httpRequest.headers, "headers")));
    this.credentials = httpRequest.credentials;
    this.config = httpRequest.config;
}

From source file:suneido.SuRules.java

public SuRules(SuRules r) {
    super(r);//  www . ja v  a  2  s .co  m
    usedBy = HashMultimap.create(r.usedBy);
    dependencies = ArrayListMultimap.create(r.dependencies);
    invalid = Sets.newHashSet(r.invalid);
    attachedRules = Maps.newHashMap(r.attachedRules);
}

From source file:org.opencms.ade.sitemap.shared.CmsSitemapCategoryData.java

/**
 * Gets a multimap of the top-level entries, indexed by whether they are local categories or not.<p>
 *
 * A category counts as local if all of its parent categories are defined in the current sitemap.
 *
 * @return the multimap of entries//www  .  j  a  va 2 s .  c o  m
 */
public Multimap<Boolean, CmsCategoryTreeEntry> getEntriesIndexedByLocality() {

    return ArrayListMultimap
            .create(Multimaps.index(m_categoryEntries, new Function<CmsCategoryTreeEntry, Boolean>() {

                @SuppressWarnings("synthetic-access")
                public Boolean apply(CmsCategoryTreeEntry entry) {

                    return Boolean.valueOf(entry.getBasePath().equals(m_basePath));
                }
            }));
}

From source file:org.dishevelled.bio.variant.vcf.header.VcfSampleHeaderLine.java

/**
 * Parse the specified value into a VCF SAMPLE header line.
 *
 * @param value value, must not be null/*  w  w w .ja v  a 2 s .c o m*/
 * @return the specified value parsed into a VCF SAMPLE header line
 */
public static VcfSampleHeaderLine valueOf(final String value) {
    checkNotNull(value);
    checkArgument(value.startsWith("##SAMPLE="));
    ListMultimap<String, String> entries = parseEntries(value.replace("##SAMPLE=", ""));

    String id = requiredString("ID", entries);

    ListMultimap<String, String> attributes = ArrayListMultimap.create(entries);
    attributes.removeAll("ID");

    return new VcfSampleHeaderLine(id, attributes);
}