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

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

Introduction

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

Prototype

public static <E> ImmutableSet<E> of(E element) 

Source Link

Usage

From source file:org.jclouds.cloudstack.options.AddClusterOptions.java

/**
 * @param allocationState Allocation state of this Host for allocation of new resources
 *///from  ww  w.ja  v  a 2  s .  c  o m
public AddClusterOptions allocationState(AllocationState allocationState) {
    this.queryParameters.replaceValues("allocationstate", ImmutableSet.of(allocationState.toString()));
    return this;
}

From source file:fr.univnantes.lina.uima.tkregex.AutomatonFactory.java

public static Automaton createZeroOneAutomaton(Automaton automaton) {
    Automaton a = automaton.deepClone();
    Set<State> states = new TreeSet<State>(a.getStates());
    State acceptingState = new State();
    states.add(acceptingState);// w w  w.ja v  a2 s. co  m
    for (State s : a.getAcceptingStates())
        addEpsilon(s, acceptingState);
    addEpsilon(a.getInitState(), acceptingState);
    Automaton zeroOneAutomaton = new Automaton(a.getInitState(), ImmutableSet.of(acceptingState), states);
    return zeroOneAutomaton;
}

From source file:org.jclouds.cloudstack.options.CreateDomainOptions.java

/**
 * @param networkDomain/*from ww  w .j  a v a 2s.com*/
 *       network domain for networks in the domain
 */
public CreateDomainOptions networkDomain(String networkDomain) {
    this.queryParameters.replaceValues("networkdomain", ImmutableSet.of(networkDomain));
    return this;
}

From source file:concretisations.life.pieces.Null.java

@Override
public Set<? extends MutationInterface> computePotentialMutations(final ManagedCellInterface cell,
        final SideInterface side) {
    if (this.count(cell) == Null.NUMBER_OF_NEIGHBOUR_CELLS_WITH_A_PAWN_IN_ORDER_TO_BORN) {
        return ImmutableSet.of(AtomicMutationFactory.newBirth(cell, side, LifePieceSet.PAWN)); // NOPMD 
    }//from ww w . j  a v a  2 s. c  o m
    return MutationInterface.NULL_POTENTIAL_MUTATION_SET;
}

From source file:com.opengamma.financial.currency.YCNSPnLSeriesCurrencyConversionFunction.java

@Override
public Set<ValueSpecification> getResults(final FunctionCompilationContext context,
        final ComputationTarget target) {
    final ValueProperties properties = createValueProperties().withAny(ValuePropertyNames.CURRENCY)
            .withAny(ValuePropertyNames.CURVE).withAny(ValuePropertyNames.SAMPLING_PERIOD)
            .withAny(ValuePropertyNames.SCHEDULE_CALCULATOR).withAny(ValuePropertyNames.SAMPLING_FUNCTION)
            .with(YieldCurveNodePnLFunction.PROPERTY_PNL_CONTRIBUTIONS,
                    ValueRequirementNames.YIELD_CURVE_NODE_SENSITIVITIES)
            .get();/*from w  w  w  . ja  v a2s. c o  m*/
    return ImmutableSet
            .of(new ValueSpecification(ValueRequirementNames.PNL_SERIES, target.toSpecification(), properties));
}

From source file:org.jclouds.cloudstack.options.UpdateTemplatePermissionsOptions.java

/**
 * a list of accounts. If specified, "op" parameter has to be passed in.
 *///  w  w  w . jav  a 2 s  .c om
public UpdateTemplatePermissionsOptions accounts(Iterable<String> accounts) {
    this.queryParameters.replaceValues("accounts", ImmutableSet.of(Joiner.on(',').join(accounts)));
    return this;
}

From source file:com.google.devtools.moe.client.dvcs.hg.HgWriterCreator.java

@Override
public Writer create(Map<String, String> options) {
    Utils.checkKeys(options, ImmutableSet.of("revision"));
    // Sanity check: make sure the given revision exists.
    Revision rev = revHistory.findHighestRevision(options.get("revision"));
    HgClonedRepository freshClone = freshCloneSupplier.get();
    freshClone.updateToRevision(rev.revId());
    return new HgWriter(freshClone);
}

From source file:org.jclouds.cloudstack.options.UpdateUserOptions.java

/**
 * @param email user email address/*w w  w .  j ava2 s.c  om*/
 */
public UpdateUserOptions email(String email) {
    this.queryParameters.replaceValues("email", ImmutableSet.of(email));
    return this;
}

From source file:org.jclouds.cloudstack.options.UpdateISOOptions.java

/**
 * @param bootable true if image is bootable, false otherwise
 */// w  ww .  j a  va  2s  .co m
public UpdateISOOptions bootable(boolean bootable) {
    this.queryParameters.replaceValues("bootable", ImmutableSet.of(bootable + ""));
    return this;
}

From source file:com.google.devtools.moe.client.dvcs.git.GitWriterCreator.java

@Override
public Writer create(Map<String, String> options) {
    Utils.checkKeys(options, ImmutableSet.of("revision"));
    // Sanity check: make sure the given revision exists.
    Revision rev = revHistory.findHighestRevision(options.get("revision"));
    GitClonedRepository freshClone = freshCloneSupplier.get();
    freshClone.updateToRevision(rev.revId());
    return new GitWriter(freshClone);
}