Example usage for java.lang Enum toString

List of usage examples for java.lang Enum toString

Introduction

In this page you can find the example usage for java.lang Enum toString.

Prototype

public String toString() 

Source Link

Document

Returns the name of this enum constant, as contained in the declaration.

Usage

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Returns the statement multi-value with the specified name.
 * <p>//  w w w  .ja va  2  s  .  c  om
 *
 * The following statements returns ["value1", "value2"]:
 *
 * <pre>
 * statement "value1"
 * statement "value2"
 * </pre>
 *
 * @param name
 *            the {@link Enum} name.
 *
 * @return the {@link List} values.
 */
public <T> List<T> multiValue(Enum<?> name) {
    return multiValue(name.toString());
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Returns the statement value with the specified name as a list.
 * <p>/*from   w  ww  .j  ava  2 s. com*/
 *
 * The following statement returns ["value1", "value2"]:
 *
 * <pre>
 * statement "value1, value2"
 * </pre>
 *
 * @param name
 *            the {@link Enum} name.
 *
 * @return the {@link List} list or {@code null}.
 */
public List<Object> valueAsList(Enum<?> name) {
    return valueAsList(name.toString());
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Checks if the key is allowed statement.
 *
 * @param name/*from   ww w  .  java  2  s  . c o m*/
 *            the {@link Enum} name of the key.
 *
 * @return {@code true} if the key is allowed.
 */
public boolean isAllowedKey(Enum<?> name) {
    return isAllowedKey(name.toString());
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Returns the statement value with the specified name as a list.
 * <p>/*w ww .  j av a2s  .  co  m*/
 *
 * The following statement returns ["value1", "value2"]:
 *
 * <pre>
 * statement "value1, value2"
 * </pre>
 *
 * @param name
 *            the {@link Enum} name.
 *
 * @return the {@link List} list or {@code null}.
 */
public List<String> valueAsStringList(Enum<?> name) {
    return valueAsStringList(name.toString());
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Returns the statement value with the specified name.
 * <p>//  w w w. ja  v  a2 s.c  om
 *
 * The following statement returns "value":
 *
 * <pre>
 * statement key: "value"
 * </pre>
 *
 * @param name
 *            the {@link Enum} name.
 *
 * @param key
 *            the {@link Enum} key.
 *
 * @return the {@link Object} value or {@code null}.
 */
public <T> T mapValue(Enum<?> name, Enum<?> key) {
    return mapValue(name.toString(), key.toString());
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Sets the statement have a value as the first argument.
 *
 * <pre>//from  w  w w  .ja v  a 2s  . co  m
 * statement "value"
 * </pre>
 *
 * @param name
 *            the statement {@link Enum} name.
 *
 * @param haveName
 *            set to {@code true} if the statement have a value as the first
 *            argument.
 *
 * @see #value(String)
 * @see #valueAsList(String)
 */
public void setAllowValue(Enum<?> name, boolean haveName) {
    setAllowValue(name.toString(), haveName);
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Adds allowed statement keys.//from   ww  w.  ja  va2  s.  c  om
 *
 * <pre>
 * statement key: "value"
 * </pre>
 *
 * @param name
 *            the statement {@link Enum} name.
 *
 * @param keys
 *            the array with allowed {@link Enum} keys.
 *
 * @see #mapValue(String, String)
 */
public void addAllowedKeys(Enum<?> name, Enum<?>... keys) {
    addAllowedKeys(name.toString(), convert(keys));
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Returns the statement value with the specified name as URI.
 * <p>/*from ww  w. j  ava 2  s .  c  o m*/
 *
 * The following statement returns "value":
 *
 * <pre>
 * statement key: "http://address.com/file"
 * </pre>
 *
 * @param name
 *            the {@link Enum} name.
 *
 * @param key
 *            the {@link Enum} key.
 *
 * @return the {@link URI} or {@code null}.
 *
 * @throws ConvertException
 *             if there were errors converting the path to the URI.
 */
public URI mapValueAsURI(Enum<?> name, Enum<?> key) {
    return mapValueAsURI(name.toString(), key.toString());
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Returns the statement multi-value with the specified name.
 * <p>//from   ww w. j a v a2s  .c  o  m
 *
 * The following statements returns ["value1", "value2"]:
 *
 * <pre>
 * statement key: "value1"
 * statement key: "value2"
 * </pre>
 *
 * @param name
 *            the {@link Enum} name.
 *
 * @param key
 *            the {@link Enum} key.
 *
 * @return the {@link List} values or {@code null}.
 */
public <T> List<T> mapMultiValue(Enum<?> name, Enum<?> key) {
    return mapMultiValue(name.toString(), key.toString());
}

From source file:com.anrisoftware.sscontrol.core.groovy.statementsmap.StatementsMap.java

/**
 * Returns the statement values with the specified name.
 * <p>// ww w .  j  a  va2 s.c  o  m
 *
 * The following statement returns {@code ["value1", "value2"]}
 *
 * <pre>
 * statement key: "value1, value2"
 * </pre>
 *
 * @param name
 *            the {@link Enum} name.
 *
 * @param key
 *            the {@link Enum} key.
 *
 * @return the {@link List} values.
 */
public List<Object> mapValueAsList(Enum<?> name, Enum<?> key) {
    return mapValueAsList(name.toString(), key.toString());
}