Example usage for java.util Collections singleton

List of usage examples for java.util Collections singleton

Introduction

In this page you can find the example usage for java.util Collections singleton.

Prototype

public static <T> Set<T> singleton(T o) 

Source Link

Document

Returns an immutable set containing only the specified object.

Usage

From source file:mj.ocraptor.extraction.tika.parser.xml.FictionBookParser.java

@Override
public Set<MediaType> getSupportedTypes(ParseContext context) {
    return Collections.singleton(MediaType.application("x-fictionbook+xml"));
}

From source file:com.opengamma.financial.analytics.model.bond.BondPV01CountryCurveFunction.java

@Override
public Set<ValueSpecification> getResults(final FunctionCompilationContext context,
        final ComputationTarget target) {
    return Collections.singleton(new ValueSpecification(ValueRequirementNames.PV01, target.toSpecification(),
            createValueProperties().with(ValuePropertyNames.COUNTRY, BondFunctionUtils.getCountryName(target))
                    .withAny(ValuePropertyNames.CURVE).get()));
}

From source file:com.opengamma.financial.analytics.model.bond.BondPV01CurrencyCurveFunction.java

@Override
public Set<ValueSpecification> getResults(final FunctionCompilationContext context,
        final ComputationTarget target) {
    return Collections.singleton(new ValueSpecification(ValueRequirementNames.PV01, target.toSpecification(),
            createValueProperties().with(ValuePropertyNames.CURRENCY, BondFunctionUtils.getCurrencyName(target))
                    .withAny(ValuePropertyNames.CURVE).get()));
}

From source file:com.opengamma.financial.analytics.model.bond.BondPresentValueCountryCurveFunction.java

@Override
public Set<ValueSpecification> getResults(final FunctionCompilationContext context,
        final ComputationTarget target) {
    return Collections
            .singleton(new ValueSpecification(ValueRequirementNames.PRESENT_VALUE, target.toSpecification(),
                    createValueProperties()
                            .with(ValuePropertyNames.COUNTRY, BondFunctionUtils.getCountryName(target))
                            .withAny(ValuePropertyNames.CURVE).get()));
}

From source file:com.opengamma.financial.analytics.model.bond.BondPresentValueCurrencyCurveFunction.java

@Override
public Set<ValueSpecification> getResults(final FunctionCompilationContext context,
        final ComputationTarget target) {
    return Collections
            .singleton(new ValueSpecification(ValueRequirementNames.PRESENT_VALUE, target.toSpecification(),
                    createValueProperties()
                            .with(ValuePropertyNames.CURRENCY, BondFunctionUtils.getCurrencyName(target))
                            .withAny(ValuePropertyNames.CURVE).get()));
}

From source file:com.nesscomputing.cache.NamespacedCache.java

/**
 * Set a cache entry with a given value and expiration date.  Note that the value byte array
 * is shared, and the cache infrastructure assumes that it owns the passed in byte array.
 * @see NessCache#set(String, Collection)
 *///  ww w. ja va  2 s  .  com
public void set(String key, byte[] value, DateTime expiry) {
    cache.set(namespace, Collections.singleton(CacheStores.fromSharedBytes(key, value, expiry)));
}

From source file:org.graylog.plugins.usagestatistics.UsageStatsModule.java

@Override
public Set<? extends PluginConfigBean> getConfigBeans() {
    return Collections.singleton(new UsageStatsConfiguration());
}

From source file:com.vrem.wifianalyzer.wifi.predicate.FilterPredicate.java

public static Predicate<WiFiDetail> makeOtherPredicate(Settings settings) {
    return new FilterPredicate(settings, Collections.singleton(settings.getWiFiBand()));
}

From source file:com.vaynberg.wicket.select2.Select2Choice.java

@Override
protected void convertInput() {

    String input = getWebRequest().getRequestParameters().getParameterValue(getInputName()).toString();
    if (Strings.isEmpty(input)) {
        setConvertedInput(null);/* w  w w . jav  a  2s.c o m*/
    } else {
        setConvertedInput(getProvider().toChoices(Collections.singleton(input)).iterator().next());
    }
}