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:com.codebullets.sagalib.annotations.AnnotationSaga.java

@Override
public Collection<KeyReader> keyReaders() {
    return ImmutableSet.of(KeyReaders.forMessage(AnnotationFinishMessage.class, AnnotationFinishMessage::key));
}

From source file:org.onosproject.net.link.LinkProviderRegistryAdapter.java

@Override
public Set<ProviderId> getProviders() {
    return ImmutableSet.of(providerService.provider().id());
}

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

/**
 * the url to which the ISO would be extracted
 *///from  w  w w  . j  a v a 2 s.  c o  m
public ExtractTemplateOptions url(String url) {
    this.queryParameters.replaceValues("url", ImmutableSet.of(url));
    return this;
}

From source file:com.opengamma.financial.analytics.timeseries.AliasedHistoricalTimeSeriesLatestValueFunction.java

/**
 * Constructs an instance//from  ww  w. j a va2 s  .  com
 *
 * @param htsDataField  the historical time-series data field, not null
 * @param aliasedValueRequirementName  the value requirement name under which to expose the output, not null
 */
public AliasedHistoricalTimeSeriesLatestValueFunction(final String htsDataField,
        final String aliasedValueRequirementName) {
    super(aliasedValueRequirementName, ValueRequirementNames.HISTORICAL_TIME_SERIES_LATEST,
            ValueProperties.with(HistoricalTimeSeriesFunctionUtils.DATA_FIELD_PROPERTY, htsDataField).get(),
            ImmutableSet.of(HistoricalTimeSeriesFunctionUtils.AGE_LIMIT_PROPERTY),
            ComputationTargetType.PORTFOLIO_NODE.or(ComputationTargetType.POSITION));
}

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

/**
 * @param name/*from  w ww .  j av a  2 s.  c om*/
 *           the SSHKeyPair name
 */
public ListSSHKeyPairsOptions name(String name) {
    this.queryParameters.replaceValues("name", ImmutableSet.of(name));
    return this;
}

From source file:com.wrmsr.wava.basic.match.LoopMatching.java

public static Stream<SelfLoopMatch> matchSelfLoop(BasicLoopInfo loopInfo, Basic basic) {
    if (!loopInfo.isLoop(basic.getName()) || basic.getBreakTable().getTargets().size() != 1
            || basic.getAllTargets().size() != 2 || !basic.getAllTargets().contains(basic.getName())
            || !loopInfo.getBackEdges(basic.getName()).equals(ImmutableSet.of(basic.getName()))) {
        return Stream.empty();
    }/*from   w ww  .j  a va2  s .  c  o m*/
    if (basic.getBreakTable().getDefaultTarget().equals(basic.getName())) {
        return Stream.of(new SelfLoopMatch(basic.getBreakTable().getCondition(),
                getOnlyElement(basic.getBreakTable().getTargets())));
    } else {
        return Stream
                .of(new SelfLoopMatch(new Unary(UnaryOp.EqZ, Type.I32, basic.getBreakTable().getCondition()),
                        basic.getBreakTable().getDefaultTarget()));
    }
}

From source file:de.monticore.CommonModelNameCalculator.java

@Override
public Set<String> calculateModelNames(String name, SymbolKind kind) {
    return ImmutableSet.of(name);
}

From source file:vazkii.quark.world.entity.EntityAshen.java

@Override
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) {
    super.setEquipmentBasedOnDifficulty(difficulty);

    ItemStack stack = new ItemStack(Items.TIPPED_ARROW);
    PotionUtils.appendEffects(stack, ImmutableSet.of(new PotionEffect(MobEffects.BLINDNESS, 50, 0)));
    setHeldItem(EnumHand.OFF_HAND, stack);
}

From source file:com.continuuity.loom.scheduler.callback.DummyService.java

public DummyService(int port, HttpHandler handler) {
    NettyHttpService.Builder builder = NettyHttpService.builder();
    builder.addHttpHandlers(ImmutableSet.of(handler));

    builder.setHost("localhost");
    builder.setPort(port);/*  www  .  j  a  v a  2 s .c o m*/

    builder.setConnectionBacklog(20000);
    builder.setExecThreadPoolSize(10);
    builder.setBossThreadPoolSize(1);
    builder.setWorkerThreadPoolSize(1);

    this.httpService = builder.build();
}

From source file:io.flutter.utils.FileWatch.java

/**
 * Starts watching a single file or directory.
 *///from  w ww  .ja  v a2 s . com
public static @NotNull FileWatch subscribe(@NotNull VirtualFile file, @NotNull Runnable callback) {
    final FileWatch watcher = new FileWatch(ImmutableSet.of(new Location(file, null)), callback);
    subscriptions.subscribe(watcher);
    return watcher;
}