Code example for CaseFormat

Methods: to

0
    * the instance is stopped 
    */ 
   STOPPED, UNRECOGNIZED;
 
   public String value() {
      return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
   } 
 
   @Override 
   public String toString() {
      return value(); 
   } 
 
   public static InstanceState fromValue(String state) {
      try { 
         return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(state, "state")));
      } catch (IllegalArgumentException e) {
         return UNRECOGNIZED;
      } 
   }