Example usage for com.google.common.collect ImmutableSortedMap of

List of usage examples for com.google.common.collect ImmutableSortedMap of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSortedMap of.

Prototype

public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(K k1, V v1) 

Source Link

Usage

From source file:org.bonitasoft.web.designer.experimental.mapping.DimensionFactory.java

public Map<String, Integer> create(int dimension) {
    return ImmutableSortedMap.of("xs", dimension);
}

From source file:io.prestosql.plugin.ml.FeatureVector.java

@VisibleForTesting
public FeatureVector(int feature, double value) {
    this.features = ImmutableSortedMap.of(feature, value);
}

From source file:com.noodlewiz.xjavab.core.ValueParam.java

/**
 * Returns a ValueParam containing a single entry.
 *//*w  ww. j a v a  2 s. c om*/
public ValueParam(final long k1, final long v1) {
    mMap = ImmutableSortedMap.of(k1, v1);
}

From source file:com.google.enterprise.adaptor.fs.AccumulatingAsyncDocIdPusher.java

@Override
public boolean pushNamedResource(DocId docId, Acl acl) {
    try {/* ww w  .  j a  va  2s .co  m*/
        return pushNamedResources(ImmutableSortedMap.of(docId, acl)) == null;
    } catch (InterruptedException e) {
        log.warning("Interrupted. Aborted getDocIds");
        Thread.currentThread().interrupt();
    }
    return false;
}

From source file:com.edmunds.etm.runtime.api.ApplicationSeries.java

public ApplicationSeries(Application application) {
    Validate.notNull(application, "Application is null");

    this.name = application.getName();
    this.applicationsByVersion = ImmutableSortedMap.of(application.getVersion(),
            new Application(application, true));
}

From source file:org.apache.calcite.util.NameMap.java

/** Returns a map containing all the entries in the map that match the given
 * name. If case-sensitive, that map will have 0 or 1 elements; if
 * case-insensitive, it may have 0 or more. */
public NavigableMap<String, V> range(String name, boolean caseSensitive) {
    if (caseSensitive) {
        if (map.containsKey(name)) {
            return ImmutableSortedMap.of(name, map.get(name));
        } else {//from www .  ja v a 2  s .co  m
            return ImmutableSortedMap.of();
        }
    } else {
        return map.subMap(name.toUpperCase(Locale.ROOT), true, name.toLowerCase(Locale.ROOT), true);
    }
}

From source file:google.registry.tools.CreateTldCommand.java

@Override
protected void initTldCommand() throws Exception {
    checkArgument(initialTldState == null || tldStateTransitions.isEmpty(),
            "Don't pass both --initial_tld_state and --tld_state_transitions");
    checkArgument(initialRenewBillingCost == null || renewBillingCostTransitions.isEmpty(),
            "Don't pass both --initial_renew_billing_cost and --renew_billing_cost_transitions");
    if (initialRenewBillingCost != null) {
        renewBillingCostTransitions = ImmutableSortedMap.of(START_OF_TIME, initialRenewBillingCost);
    }//from  w w  w.  ja  v  a2  s  . c om
    checkArgument(mainParameters.size() == 1, "Can't create more than one TLD at a time");
    checkArgument(!Strings.isNullOrEmpty(roidSuffix), "The roid suffix is required when creating a TLD");
}

From source file:google.registry.tools.CreateTldCommand.java

@Override
void setCommandSpecificProperties(Registry.Builder builder) {
    // Pick up the currency from the create cost. Since all costs must be in one currency, and that
    // condition is enforced by the builder, it doesn't matter which cost we choose it from.
    CurrencyUnit currency = createBillingCost != null ? createBillingCost.getCurrencyUnit()
            : Registry.DEFAULT_CURRENCY;

    builder.setCurrency(currency);/*from   w w w  .ja v  a  2s. c o m*/

    // If this is a non-default currency and the user hasn't specified an EAP fee schedule, set the
    // EAP fee schedule to a matching currency.
    if (!currency.equals(Registry.DEFAULT_CURRENCY) && eapFeeSchedule.isEmpty()) {
        builder.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(currency)));
    }
}

From source file:ec.tss.tsproviders.DataSource.java

@Nonnull
public static DataSource of(@Nonnull String providerName, @Nonnull String version, @Nonnull String key,
        @Nonnull String value) {//  w w w.  j  a va  2s  . co m
    Objects.requireNonNull(providerName, "providerName");
    Objects.requireNonNull(version, "version");
    return new DataSource(providerName, version, ImmutableSortedMap.of(key, value));
}

From source file:ec.tss.tsproviders.DataSet.java

@Nonnull
public static DataSet of(@Nonnull DataSource dataSource, @Nonnull Kind kind, @Nonnull String key,
        @Nonnull String value) {// w ww  . j a va 2 s  . com
    Objects.requireNonNull(dataSource, "dataSource");
    Objects.requireNonNull(kind, "kind");
    return new DataSet(dataSource, kind, ImmutableSortedMap.of(key, value));
}