package com.zy.core.enums; public enum SlaveType { Crn, Devp, Barcode, Led, Scale, Car, Rgv ; public static SlaveType findInstance(String s){ for (SlaveType type : SlaveType.values()) { if (type.toString().equals(s)) { return type; } } return null; } }