1 16 17 package org.springframework.core.enums; 18 19 import org.springframework.util.Assert; 20 21 32 public class StringCodedLabeledEnum extends AbstractGenericLabeledEnum { 33 34 37 private final String code; 38 39 40 45 public StringCodedLabeledEnum(String code, String label) { 46 super(label); 47 Assert.hasText(code, "'code' must not be empty"); 48 this.code = code; 49 } 50 51 52 public Comparable getCode() { 53 return code; 54 } 55 56 59 public String getStringCode() { 60 return (String ) getCode(); 61 } 62 63 } 64 | Popular Tags |