Example usage for java.util Collections singletonList

List of usage examples for java.util Collections singletonList

Introduction

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

Prototype

public static <T> List<T> singletonList(T o) 

Source Link

Document

Returns an immutable list containing only the specified object.

Usage

From source file:com.hp.autonomy.aci.content.fieldtext.MATCH.java

/**
 * Creates a new single field MATCH fieldtext
 * @param field The name of the field/*from w  w w  .j  a  v a  2  s . c o  m*/
 * @param value The first field value
 * @param values Any additional field values
 */
public MATCH(final String field, final String value, final String... values) {
    this(Collections.singletonList(field), value, values);
}

From source file:com.hp.autonomy.aci.content.fieldtext.STRING.java

/**
 * Constructs a new single field STRING fieldtext
 * @param field The field name/*from www  . ja v a 2 s  .co  m*/
 * @param value The first field value
 * @param values Any additional field values
 */
public STRING(final String field, final String value, final String... values) {
    this(Collections.singletonList(field), value, values);
}

From source file:com.hp.autonomy.aci.content.fieldtext.NOTSTRING.java

/**
 * Constructs a new single field NOTSTRING fieldtext
 * @param field The field name/* www .j  av a2 s  . co m*/
 * @param value The first field value
 * @param values Any additional field values
 */
public NOTSTRING(final String field, final String value, final String... values) {
    this(Collections.singletonList(field), value, values);
}

From source file:com.hp.autonomy.aci.content.fieldtext.STRINGALL.java

/**
 * Constructs a new single field STRINGALL fieldtext
 * @param field The field name//from  w  ww.jav  a2 s .com
 * @param value The first field value
 * @param values Any additional field values
 */
public STRINGALL(final String field, final String value, final String... values) {
    this(Collections.singletonList(field), value, values);
}

From source file:com.edmunds.etm.common.api.RegexUrlToken.java

public RegexUrlToken(String name, String value) {
    super(name, Collections.singletonList(value));
}

From source file:Main.java

/**
 * Helper function that takes an object and returns a list representation
 * of it:/*from w w  w. ja v  a2 s.  c  o  m*/
 *
 * o == null => []
 * o is a list => o
 * else => [o]
 *
 * @param o
 * @return
 */
public static List<Object> toList(final Object o) {
    if (o == null)
        return Collections.emptyList();
    else if (o instanceof List)
        return (List<Object>) o;
    else if (o.getClass().isArray()) {
        final List<Object> l = new ArrayList<Object>();
        Collections.addAll(l, (int[]) o);
        return l;
    } else
        return Collections.singletonList(o);
}

From source file:com.hp.autonomy.aci.content.fieldtext.MATCHALL.java

public MATCHALL(final String field, final Iterable<String> values) {
    this(Collections.singletonList(field), values);
}

From source file:com.hp.autonomy.aci.content.fieldtext.NOTMATCH.java

public NOTMATCH(final String field, final Iterable<String> values) {
    this(Collections.singletonList(field), values);
}

From source file:gov.nih.nci.caarray.web.helper.EmailHelper.java

/**
 * @param registrationRequest request/*ww  w. j a v a 2s .  co m*/
 * @throws MessagingException on other error
 */
public static void registerEmail(RegistrationRequest registrationRequest) throws MessagingException {
    DataConfiguration config = ConfigurationHelper.getConfiguration();

    if (!config.getBoolean(ConfigParamEnum.SEND_CONFIRM_EMAIL.name())) {
        return;
    }

    String subject = config.getString(ConfigParamEnum.CONFIRM_EMAIL_SUBJECT.name());
    String from = config.getString(ConfigParamEnum.EMAIL_FROM.name());
    String mailBodyPattern = config.getString(ConfigParamEnum.CONFIRM_EMAIL_CONTENT.name());
    String mailBody = MessageFormat.format(mailBodyPattern, registrationRequest.getId());

    EmailUtil.sendMail(Collections.singletonList(registrationRequest.getEmail()), from, subject, mailBody);
}

From source file:net.bemacized.enderauth.discordbot.mccache.NameFetcher.java

public static Callable<Lookup<NameHistory>> getNameHistory(final UUID uuid) {
    return () -> new NameFetcher(Collections.singletonList(uuid)).call().get(uuid);
}