@Test(expected=IllegalArgumentException.class) public void testEmptyValue() throws Exception { System.out.println(DBModelAuthorizables.from("k=")); }
public static DBModelAuthorizable from(KeyValue keyValue) { String prefix = keyValue.getKey().toLowerCase(); String name = keyValue.getValue(); for(AuthorizableType type : AuthorizableType.values()) { if(prefix.equalsIgnoreCase(type.name())) { if (prefix.equalsIgnoreCase(AuthorizableType.URI.toString())) { return from(type, name); } else { return from(type, name.toLowerCase()); } } } return null; }
DBModelAuthorizables { public static DBModelAuthorizable from(KeyValue keyValue) { String prefix = keyValue.getKey().toLowerCase(); String name = keyValue.getValue(); for(AuthorizableType type : AuthorizableType.values()) { if(prefix.equalsIgnoreCase(type.name())) { if (prefix.equalsIgnoreCase(AuthorizableType.URI.toString())) { return from(type, name); } else { return from(type, name.toLowerCase()); } } } return null; } }
DBModelAuthorizables { public static DBModelAuthorizable from(KeyValue keyValue) { String prefix = keyValue.getKey().toLowerCase(); String name = keyValue.getValue(); for(AuthorizableType type : AuthorizableType.values()) { if(prefix.equalsIgnoreCase(type.name())) { if (prefix.equalsIgnoreCase(AuthorizableType.URI.toString())) { return from(type, name); } else { return from(type, name.toLowerCase()); } } } return null; }  }
DBModelAuthorizables { public static DBModelAuthorizable from(KeyValue keyValue) { String prefix = keyValue.getKey().toLowerCase(); String name = keyValue.getValue(); for(AuthorizableType type : AuthorizableType.values()) { if(prefix.equalsIgnoreCase(type.name())) { if (prefix.equalsIgnoreCase(AuthorizableType.URI.toString())) { return from(type, name); } else { return from(type, name.toLowerCase()); } } } return null; }  static DBModelAuthorizable from(KeyValue keyValue); static DBModelAuthorizable from(String s); }
DBModelAuthorizables { public static DBModelAuthorizable from(KeyValue keyValue) { String prefix = keyValue.getKey().toLowerCase(); String name = keyValue.getValue(); for(AuthorizableType type : AuthorizableType.values()) { if(prefix.equalsIgnoreCase(type.name())) { if (prefix.equalsIgnoreCase(AuthorizableType.URI.toString())) { return from(type, name); } else { return from(type, name.toLowerCase()); } } } return null; }  static DBModelAuthorizable from(KeyValue keyValue); static DBModelAuthorizable from(String s);  }