クラス AuthorityUtils


  • public final class AuthorityUtils
    extends java.lang.Object
    GrantedAuthority コレクションなどを操作するためのユーティリティメソッド。

    主に内部使用を目的としています。

    • メソッドのサマリー

      すべてのメソッド   静的メソッド   具象メソッド  
      修飾子と型 メソッド 説明
      static java.util.Set<java.lang.String>authorityListToSet​(java.util.Collection<? extends GrantedAuthority> userAuthorities)
      GrantedAuthority オブジェクトの配列をセットに変換します。
      static java.util.List<GrantedAuthority>commaSeparatedStringToAuthorityList​(java.lang.String authorityString)
      カンマ区切りの文字列表現から GrantedAuthority オブジェクトの配列を作成します(例:
      static java.util.List<GrantedAuthority>createAuthorityList​(java.lang.String... authorities)
      オーソリティを GrantedAuthority オブジェクトのリストに変換します。
      • クラス java.lang.Object から継承されたメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • フィールドの詳細

      • NO_AUTHORITIES

        public static final java.util.List<GrantedAuthority> NO_AUTHORITIES
    • メソッドの詳細

      • commaSeparatedStringToAuthorityList

        public static java.util.List<GrantedAuthority> commaSeparatedStringToAuthorityList​(java.lang.String authorityString)
        カンマ区切りの文字列表現(「ROLE_A、ROLE_B、ROLE_C」など)から GrantedAuthority オブジェクトの配列を作成します。
        パラメーター:
        authorityString - カンマ区切りの文字列
        戻り値:
        文字列をトークン化して作成された権限
      • authorityListToSet

        public static java.util.Set<java.lang.String> authorityListToSet​(java.util.Collection<? extends GrantedAuthority> userAuthorities)
        GrantedAuthority オブジェクトの配列をセットに変換します。
        戻り値:
        GrantedAuthority.getAuthority() への各呼び出しから取得された文字列のセット
      • createAuthorityList

        public static java.util.List<GrantedAuthority> createAuthorityList​(java.lang.String... authorities)
        オーソリティを GrantedAuthority オブジェクトのリストに変換します。
        パラメーター:
        authorities - 改宗する権限
        戻り値:
        GrantedAuthority オブジェクトのリスト