1 16 package org.outerj.daisy.books.store; 17 18 public final class BookAclActionType { 19 public static final BookAclActionType GRANT = new BookAclActionType("grant"); 20 public static final BookAclActionType DENY = new BookAclActionType("deny"); 21 public static final BookAclActionType NOTHING = new BookAclActionType("nothing"); 22 23 private final String name; 24 25 private BookAclActionType(String name) { 26 this.name = name; 27 } 28 29 public String toString() { 30 return name; 31 } 32 33 public static BookAclActionType fromString(String value) { 34 if (value.equals(GRANT.name)) { 35 return GRANT; 36 } else if (value.equals(DENY.name)) { 37 return DENY; 38 } else if (value.equals(NOTHING.name)) { 39 return NOTHING; 40 } else { 41 throw new RuntimeException ("Unrecognized BookAclActionType name: \"" + value + "\"."); 42 } 43 } 44 } 45 | Popular Tags |