Example usage for java.lang Enum name

List of usage examples for java.lang Enum name

Introduction

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

Prototype

String name

To view the source code for java.lang Enum name.

Click Source Link

Document

The name of this enum constant, as declared in the enum declaration.

Usage

From source file:de.ktran.anno1404warenrechner.views.PopulationNumberDialog.java

private static PopulationNumberDialog newInstance(boolean forceHouse, Enum populationType) {
    Bundle args = new Bundle();
    args.putBoolean(ARG_FORCE_HOUSE, forceHouse);
    args.putString(ARG_POPULATION_TYPE, populationType.name());
    PopulationNumberDialog fragment = new PopulationNumberDialog();
    fragment.setArguments(args);/*w w w. j a  v a 2s .  c  o  m*/
    return fragment;
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * //from  w w w.  j av  a  2 s  .  co m
 * @param node
 * @param field
 * @param value
 */
public final static void setValue(ObjectNode node, Enum<?> field, long value) {
    node.put(field.name(), value);
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * /*from  w w w  .  j  a  va  2 s . c  o  m*/
 * @param node
 * @param field
 * @return the String if the field exists, else null
 */
public final static String getString(ObjectNode node, Enum<?> field) {
    return getValue(node, field.name(), (String) null);
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * //from w w w. j  a va2  s . c  o  m
 * @param node
 * @param field
 * @param value
 */
public final static void setValue(ObjectNode node, Enum<?> field, double value) {
    node.put(field.name(), value);
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * //  ww w  .  j  a  v  a 2  s  .c  om
 * @param node
 * @param field
 * @param value
 */
public final static void setValue(ObjectNode node, Enum<?> field, boolean value) {
    node.put(field.name(), value);
}

From source file:org.cloudata.core.common.io.CWritableUtils.java

/**
 * writes String value of enum to DataOutput. 
 * @param out Dataoutput stream//from  w ww .  j a  v a  2 s.c  o m
 * @param enumVal enum value
 * @throws IOException
 */
public static void writeEnum(DataOutput out, Enum enumVal) throws IOException {
    CText.writeString(out, enumVal.name());
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * /* w w w. ja v a  2  s  .  c  o  m*/
 * @param node
 * @param field
 * @return True if all fields exist
 */
public final static boolean exist(ObjectNode node, Enum<?>... field) {
    for (Enum<?> enm : field) {
        if (!node.has(enm.name()))
            return false;
    }
    return true;
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * /*from   w ww .  j a va2  s.  c o m*/
 * @param node
 * @param field
 * @param defValue
 * @return the Integer if the field exists, else defValue
 */
public final static Integer getValue(ObjectNode node, Enum<?> field, int defValue) {
    return node.path(field.name()).asInt(defValue);
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * //  ww w .  ja va  2 s  .  co m
 * @param node
 * @param field
 * @param defValue
 * @return the Long if the field exists, else defValue
 */
public final static Long getValue(ObjectNode node, Enum<?> field, long defValue) {
    return node.path(field.name()).asLong(defValue);
}

From source file:org.waarp.common.json.JsonHandler.java

/**
 * //www.  j  av  a  2  s  .  c  o  m
 * @param node
 * @param field
 * @param defValue
 * @return the Double if the field exists, else defValue
 */
public final static Double getValue(ObjectNode node, Enum<?> field, double defValue) {
    return node.path(field.name()).asDouble(defValue);
}