Example usage for com.google.common.collect Maps newLinkedHashMap

List of usage examples for com.google.common.collect Maps newLinkedHashMap

Introduction

In this page you can find the example usage for com.google.common.collect Maps newLinkedHashMap.

Prototype

public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(Map<? extends K, ? extends V> map) 

Source Link

Document

Creates a mutable, insertion-ordered LinkedHashMap instance with the same mappings as the specified map.

Usage

From source file:org.thiesen.collections.map.impl.MutableLinkedHashMap.java

public static <K, V> MutableLinkedHashMap<K, V> copyOf(final IMap<? extends K, ? extends V> entries) {
    return new MutableLinkedHashMap<K, V>(Maps.newLinkedHashMap(entries.asMapView()));

}

From source file:com.intellij.lang.jsgraphql.ide.endpoints.JSGraphQLEndpoint.java

/**
 * Reuses an existing endpoint by applying new properties to it
 *//*from   ww w.j av a  2  s.co  m*/
public void withPropertiesFrom(JSGraphQLEndpoint other) {
    name = other.name;
    url = other.url;
    options = other.options != null ? Maps.newLinkedHashMap(other.options) : Maps.newLinkedHashMap();
}

From source file:net.roddrim.number5.tools.collect.FluentMap.java

public static <K, V> FluentMap<K, V> copyOf(@NonNull final Map<K, V> map) {
    return new FluentMap<>(Maps.newLinkedHashMap(map));
}

From source file:org.sonar.java.resolve.TypeSubstitution.java

public TypeSubstitution(TypeSubstitution typeSubstitution) {
    // copy the substitution
    this.substitutions = Maps.newLinkedHashMap(typeSubstitution.substitutions);
}

From source file:de.cosmocode.palava.ipc.memcache.JsonCacheKey.java

public JsonCacheKey(Class<? extends IpcCommand> command, IpcArguments arguments) {
    this.command = command;
    this.arguments = Maps.newLinkedHashMap(arguments);
}

From source file:org.jclouds.atmos.domain.UserMetadata.java

public UserMetadata(Map<String, String> metadata, Map<String, String> listableMetadata, Iterable<String> tags,
        Iterable<String> listableTags) {
    this.metadata = Maps.newLinkedHashMap(checkNotNull(metadata, "metadata"));
    this.listableMetadata = Maps.newLinkedHashMap(checkNotNull(listableMetadata, "listableMetadata"));
    this.tags = Sets.newLinkedHashSet(checkNotNull(tags, "tags"));
    this.listableTags = Sets.newLinkedHashSet(checkNotNull(listableTags, "listableTags"));
}

From source file:org.prebake.service.plan.RecipeMaker.java

RecipeMaker(PlanGraph pg) {
    this.nodes = Maps.newLinkedHashMap(pg.nodes);
    this.pg = pg;
}

From source file:org.jclouds.vcloud.director.v1_5.domain.dmtf.cim.CimString.java

public CimString(String value, Map<QName, String> otherAttributes) {
    this.value = value;
    this.otherAttributes = otherAttributes != null ? Maps.newLinkedHashMap(otherAttributes) : null;
}

From source file:org.jclouds.ohai.functions.NestSlashKeys.java

@Override
public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) {

    Map<String, JsonBall> autoAttrs = mergeSameKeys(from);

    Map<String, JsonBall> modifiableFlatMap = Maps
            .newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() {

                @Override/*w  ww .j a  v a2s  .  co  m*/
                public boolean apply(String input) {
                    return input.indexOf('/') == -1;
                }

            }));
    Map<String, JsonBall> withSlashesMap = Maps.difference(autoAttrs, modifiableFlatMap).entriesOnlyOnLeft();
    for (Entry<String, JsonBall> entry : withSlashesMap.entrySet()) {
        List<String> keyParts = Lists.newArrayList(Splitter.on('/').split(entry.getKey()));
        JsonBall toInsert = entry.getValue();
        try {
            putUnderContext(keyParts, toInsert, modifiableFlatMap);
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException("error inserting value in entry: " + entry.getKey(), e);
        }
    }
    return modifiableFlatMap;
}

From source file:com.github.fge.jsonschema.core.processing.ProcessorSelectorPredicate.java

/**
 * Package local constructor//from   ww  w .  j a v  a 2 s . co  m
 *
 * @param selector a {@link ProcessorSelector}
 * @param predicate the new predicate
 *
 * @see ProcessorSelector#when(Predicate)
 */
ProcessorSelectorPredicate(final ProcessorSelector<IN, OUT> selector, final Predicate<IN> predicate) {
    this.predicate = predicate;
    choices = Maps.newLinkedHashMap(selector.choices);
    byDefault = selector.byDefault;
}