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); }
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); } }