public static Identity valueOf(String identityStr) {
    String[] info = identityStr.split(":");
    Type type = Type.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, info[0]));
    if (info.length == 1) {
      return new Identity(type, null);
    } else if (info.length == 2) {
      return new Identity(type, info[1]);
    } else {
      throw new IllegalArgumentException("Illegal identity string: \"" + identityStr + "\"");
    }
  }
public static Identity valueOf ( String identityStr ) { String [ ] info = identityStr . split ( ":" ) ; Type type = Type . valueOf ( CaseFormat . LOWER_CAMEL . to ( CaseFormat . UPPER_UNDERSCORE , info [ 0 ] ) ) ; if ( info . length == 1 ) { return new Identity ( type , null ) ; } else if ( info . length == 2 ) { return new Identity ( type , info [ 1 ] ) ; } else { throw new IllegalArgumentException ( "Illegal identity string: \"" + identityStr + "\"" ) ; } }
Converts a string to an {@code Identity}. Used primarily for converting protobuf-generated
policy identities to {@code Identity} objects.