@Test public void testConvertToScopeList() { final List<Scope> scopeList = Scope.convertToScopeList(TEST_SCOPE_CODE_LIST); assertEquals(TEST_SCOPE_LIST, scopeList); }
public static List<Scope> convertToScopeList(final List<String> scopeCodeList) { final List<Scope> scopeList = new ArrayList<>(); for (final String scopeCode : scopeCodeList) { final Scope scope = findScope(scopeCode); if (scope != null) { scopeList.add(scope); } else { scopeList.add(new Scope(scopeCode)); } } return scopeList; }
Scope { public static List<Scope> convertToScopeList(final List<String> scopeCodeList) { final List<Scope> scopeList = new ArrayList<>(); for (final String scopeCode : scopeCodeList) { final Scope scope = findScope(scopeCode); if (scope != null) { scopeList.add(scope); } else { scopeList.add(new Scope(scopeCode)); } } return scopeList; } }
Scope { public static List<Scope> convertToScopeList(final List<String> scopeCodeList) { final List<Scope> scopeList = new ArrayList<>(); for (final String scopeCode : scopeCodeList) { final Scope scope = findScope(scopeCode); if (scope != null) { scopeList.add(scope); } else { scopeList.add(new Scope(scopeCode)); } } return scopeList; } Scope(@NonNull final String code); }
Scope { public static List<Scope> convertToScopeList(final List<String> scopeCodeList) { final List<Scope> scopeList = new ArrayList<>(); for (final String scopeCode : scopeCodeList) { final Scope scope = findScope(scopeCode); if (scope != null) { scopeList.add(scope); } else { scopeList.add(new Scope(scopeCode)); } } return scopeList; } Scope(@NonNull final String code); @Nullable static Scope findScope(final String scopeCode); static String join(@Nullable final List<Scope> scopes); static List<Scope> parseToList(@Nullable final String scopeCodeStr); static List<Scope> convertToScopeList(final List<String> scopeCodeList); static List<String> convertToCodeList(final List<Scope> scopeList); @NonNull String getCode(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
Scope { public static List<Scope> convertToScopeList(final List<String> scopeCodeList) { final List<Scope> scopeList = new ArrayList<>(); for (final String scopeCode : scopeCodeList) { final Scope scope = findScope(scopeCode); if (scope != null) { scopeList.add(scope); } else { scopeList.add(new Scope(scopeCode)); } } return scopeList; } Scope(@NonNull final String code); @Nullable static Scope findScope(final String scopeCode); static String join(@Nullable final List<Scope> scopes); static List<Scope> parseToList(@Nullable final String scopeCodeStr); static List<Scope> convertToScopeList(final List<String> scopeCodeList); static List<String> convertToCodeList(final List<Scope> scopeList); @NonNull String getCode(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final Scope PROFILE; static final Scope FRIEND; static final Scope GROUP; static final Scope MESSAGE; static final Scope OPENID_CONNECT; static final Scope OC_EMAIL; static final Scope OC_PHONE_NUMBER; static final Scope OC_GENDER; static final Scope OC_BIRTHDATE; static final Scope OC_ADDRESS; static final Scope OC_REAL_NAME; static final Scope ONE_TIME_SHARE; static final Scope OPEN_CHAT_TERM_STATUS; static final Scope OPEN_CHAT_ROOM_CREATE_JOIN; static final Scope OPEN_CHAT_SUBSCRIPTION_INFO; }