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

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

Introduction

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

Prototype

public static <E extends Comparable<? super E>> ImmutableSortedSet<E> of(E element) 

Source Link

Usage

From source file:edu.umn.nlptab.uimatyping.TypeFilterLists.java

public static TypeFilterLists create(String[] typeWhitelist, String[] typeBlacklist) {
    ImmutableSet<String> whitelistSet;
    if (typeWhitelist.length == 0) {
        whitelistSet = ImmutableSortedSet.of(CAS.TYPE_NAME_TOP);
    } else {//  www . j av a  2 s.  c om
        whitelistSet = ImmutableSortedSet.copyOf(typeWhitelist);
    }
    ImmutableSet<String> blacklistSet = ImmutableSortedSet.copyOf(typeBlacklist);
    return new TypeFilterLists(whitelistSet, blacklistSet);
}

From source file:com.opengamma.financial.security.cds.CDSIndexTerms.java

/**
 * Obtains a {@link CDSIndexTerms} from a tenor.
 * //from  w w  w .ja va 2s  .c o m
 * @param tenor  the tenor to warp in the terms, not null
 * @return the terms, not null
 */
public static CDSIndexTerms of(Tenor tenor) {
    ArgumentChecker.notNull(tenor, "tenor");
    return new CDSIndexTerms(ImmutableSortedSet.of(tenor));
}

From source file:com.facebook.buck.cxx.CxxBinaryImplicitFlavors.java

public ImmutableSortedSet<Flavor> addImplicitFlavorsForRuleTypes(ImmutableSortedSet<Flavor> argDefaultFlavors,
        RuleType... types) {/* w ww.j  a v a  2 s  .c om*/
    Optional<Flavor> platformFlavor = getCxxPlatformsProvider().getUnresolvedCxxPlatforms()
            .getFlavor(argDefaultFlavors);

    for (RuleType type : types) {
        ImmutableMap<String, Flavor> libraryDefaults = cxxBuckConfig.getDefaultFlavorsForRuleType(type);

        if (!platformFlavor.isPresent()) {
            platformFlavor = Optional.ofNullable(libraryDefaults.get(CxxBuckConfig.DEFAULT_FLAVOR_PLATFORM));
        }
    }

    if (platformFlavor.isPresent()) {
        return ImmutableSortedSet.of(platformFlavor.get());
    } else {
        // To avoid changing the output path of binaries built without a flavor,
        // we'll default to no flavor, which implicitly builds the default platform.
        return ImmutableSortedSet.of();
    }
}

From source file:com.facebook.buck.android.AndroidBuildConfigJavaLibrary.java

AndroidBuildConfigJavaLibrary(BuildRuleParams params, SourcePathResolver resolver,
        SourcePathRuleFinder ruleFinder, JavacOptions javacOptions, BuildTarget abiJar,
        ImmutableSortedSet<SourcePath> abiInputs, AndroidBuildConfig androidBuildConfig) {
    super(params, resolver, ruleFinder,
            /* srcs */ ImmutableSortedSet.of(new BuildTargetSourcePath(androidBuildConfig.getBuildTarget())),
            /* resources */ ImmutableSortedSet.of(), javacOptions.getGeneratedSourceFolderName(),
            /* proguardConfig */ Optional.empty(), /* postprocessClassesCommands */ ImmutableList.of(),
            /* exportedDeps */ ImmutableSortedSet.of(), /* providedDeps */ ImmutableSortedSet.of(), abiJar,
            abiInputs, /* trackClassUsage */ javacOptions.trackClassUsage(),
            /* additionalClasspathEntries */ ImmutableSet.of(),
            new JavacToJarStepFactory(javacOptions, JavacOptionsAmender.IDENTITY),
            /* resourcesRoot */ Optional.empty(), /* manifest file */ Optional.empty(),
            /* mavenCoords */ Optional.empty(), /* tests */ ImmutableSortedSet.of(),
            /* classesToRemoveFromJar */ ImmutableSet.of());
    this.androidBuildConfig = androidBuildConfig;
    Preconditions.checkState(params.getDeps().contains(androidBuildConfig),
            "%s must depend on the AndroidBuildConfig whose output is in this rule's srcs.",
            params.getBuildTarget());//from   w  ww. jav a2  s .  c o m
}

From source file:com.opengamma.basics.currency.MultiCurrencyAmount.java

/**
 * Obtains a {@code MultiCurrencyAmount} from a currency and amount.
 * //from   w  w  w  .j  a  va2  s.  c o  m
 * @param currency  the currency
 * @param amount  the amount
 * @return the amount
 */
public static MultiCurrencyAmount of(Currency currency, double amount) {
    ArgChecker.notNull(currency, "currency");
    return new MultiCurrencyAmount(ImmutableSortedSet.of(CurrencyAmount.of(currency, amount)));
}

From source file:edu.mit.streamjit.impl.compiler2.ActorGroup.java

public static ActorGroup of(Actor actor) {
    assert actor.group() == null : actor.group();
    return new ActorGroup(ImmutableSortedSet.of(actor));
}

From source file:com.facebook.buck.android.AndroidBinaryNonExoInstaller.java

protected AndroidBinaryNonExoInstaller(BuildTarget buildTarget, ProjectFilesystem projectFilesystem,
        HasInstallableApk apk) {/*  w ww.  j  ava2s  . c o m*/
    super(buildTarget, projectFilesystem);
    Preconditions.checkState(!apk.getApkInfo().getExopackageInfo().isPresent());
    this.trigger = new InstallTrigger(projectFilesystem);
    this.apk = apk;
    this.depsSupplier = MoreSuppliers.memoize(() -> ImmutableSortedSet.of((BuildRule) apk));
}

From source file:io.wcm.config.core.impl.ParameterProviderBridge.java

@Override
public SortedSet<String> getConfigurationNames() {
    if (configMetadata != null) {
        return ImmutableSortedSet.of(DEFAULT_CONFIG_NAME);
    } else {/*from  w w  w.j  a  va2  s  . c  om*/
        return ImmutableSortedSet.of();
    }
}

From source file:com.opengamma.id.ExternalIdBundle.java

/**
 * Obtains an {@code ExternalIdBundle} from an identifier.
 * /*from w ww .j av a 2s. c  o m*/
 * @param externalId the external identifier to wrap in a bundle, not null
 * @return the bundle, not null
 */
public static ExternalIdBundle of(final ExternalId externalId) {
    ArgumentChecker.notNull(externalId, "externalId");
    return new ExternalIdBundle(ImmutableSortedSet.of(externalId));
}

From source file:simpleserver.config.CommandList.java

public void setGroup(String command, int group) {
    commands.put(command, ImmutableSortedSet.of(group));
    properties.setProperty(command, Integer.toString(group));
}