1 16 package org.outerj.daisy.repository.acl; 17 18 23 public final class AclActionType { 24 private final String name; 25 26 public AclActionType(String name) { 27 this.name = name; 28 } 29 30 public String toString() { 31 return name; 32 } 33 34 public static AclActionType fromString(String value) { 35 if (value.equals("grant")) 36 return GRANT; 37 else if (value.equals("deny")) 38 return DENY; 39 else if (value.equals("nothing")) 40 return DO_NOTHING; 41 else 42 throw new RuntimeException ("Unrecognized action type: " + value); 43 } 44 45 public static final AclActionType GRANT = new AclActionType("grant"); 46 public static final AclActionType DENY = new AclActionType("deny"); 47 public static final AclActionType DO_NOTHING = new AclActionType("nothing"); 48 } 49 | Popular Tags |