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

org.deeplearning4j.util.EnumUtil Maven / Gradle / Ivy

package org.deeplearning4j.util;

/**
 * Created by agibsonccc on 9/3/14.
 */
public class EnumUtil {

    public static  E parse(String value,Class clazz) {
        int i = Integer.parseInt(value);
        Enum[] constants = clazz.getEnumConstants();
        for(Enum constant : constants) {
            if(constant.ordinal() == i)
                return (E) constant;
        }

        return null;

    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy