Exemplo n.º 1
0
 public static GranteeType fromJaxb(com.zimbra.soap.type.GrantGranteeType jaxbGT) {
   for (GranteeType gt : GranteeType.values()) {
     if (gt.toJaxb() == jaxbGT) {
       return gt;
     }
   }
   throw new IllegalArgumentException("Unrecognised GranteeType:" + jaxbGT);
 }
Exemplo n.º 2
0
 public static GranteeType fromString(String s) throws ServiceException {
   try {
     return GranteeType.valueOf(s);
   } catch (IllegalArgumentException e) {
     throw ZClientException.CLIENT_ERROR(
         "invalid grantee: " + s + ", valid values: " + Arrays.asList(GranteeType.values()), e);
   }
 }