Here you can find the source of toText(T t)
Parameter | Description |
---|---|
t | The enum value to convert |
T | The type of the enum to convert, used for type safety |
public static <T extends Enum<T>> String toText(T t)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from www. ja v a 2 s .co m*/ * Converts an enum to basic text representation * * @param t The enum value to convert * @param <T> The type of the enum to convert, used for type safety * @return Returns the string representing the enum literal */ public static <T extends Enum<T>> String toText(T t) { return t.toString().replaceAll("_+", " ").toLowerCase(); } }