All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.protostuff.generator.java.EnumUtil Maven / Gradle / Ivy

There is a newer version: 3.1.40
Show newest version
package io.protostuff.generator.java;

import io.protostuff.compiler.model.EnumConstant;
import io.protostuff.generator.Formatter;

/**
 * Custom enum properties for java generator.
 *
 * @author Kostiantyn Shchepanovskyi
 */
public class EnumUtil {

    private EnumUtil() {
        throw new IllegalAccessError("Utility class");
    }

    /**
     * Returns constant name for java enum.
     */
    public static String getName(EnumConstant constant) {
        String name = constant.getName();
        String underscored = Formatter.toUnderscoreCase(name);
        return Formatter.toUpperCase(underscored);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy