All Superinterfaces:
Constructible, Extensible<Scopes>, Map<String,String>

public interface Scopes extends Constructible, Extensible<Scopes>, Map<String,String>
Scopes is a property of OAuth Flow Object.
See Also:
  • Method Details

    • addScope

      Scopes addScope(String scope, String description)
      Adds name of an existing scope object and item parameters to a Scopes instance as a key-value pair in a map.
      Parameters:
      scope - the name of a scope
      description - description of the scope. null values will be rejected (implementation will throw an exception) or ignored.
      Returns:
      Scopes instance with the added key-value pair
    • removeScope

      void removeScope(String scope)
      Removes the given scope item to this Scopes.
      Parameters:
      scope - the name of a scope
    • getScopes

      Map<String,String> getScopes()
      Returns a copy map (potentially immutable) of scopes.
      Returns:
      all items
    • setScopes

      void setScopes(Map<String,String> items)
      Set the scope items map to this Scopes
      Parameters:
      items - key-value pair in a map.
    • hasScope

      default boolean hasScope(String scope)
      Check whether a scope item is present in the map. This is a convenience method for getScopes().containsKey(name)
      Parameters:
      scope - the name of a scope.
      Returns:
      a boolean to indicate if the scope item is present or not.
    • getScope

      default String getScope(String scope)
      Returns a scope description for a given scope name. This is a convenience method for getScopes().get(name)
      Parameters:
      scope - the name of a scope.
      Returns:
      the corresponding description or null.
    • get

      Deprecated.
      since 1.1
      In the next version, Scopes will no longer extends Map, this method will no longer be present. Use getScope(String) instead.
      Specified by:
      get in interface Map<String,String>
    • containsKey

      @Deprecated boolean containsKey(Object key)
      Deprecated.
      since 1.1
      In the next version, Scopes will no longer extends Map, this method will no longer be present. Use hasScope(String) instead.
      Specified by:
      containsKey in interface Map<String,String>
    • put

      @Deprecated String put(String key, String value)
      Deprecated.
      since 1.1
      In the next version, Scopes will no longer extends Map, this method will no longer be present. Use addScope(String, String) instead.
      Specified by:
      put in interface Map<String,String>
    • putAll

      @Deprecated void putAll(Map<? extends String,? extends String> m)
      Deprecated.
      since 1.1
      In the next version, Scopes will no longer extends Map, this method will no longer be present. Use setScopes(Map) instead.
      Specified by:
      putAll in interface Map<String,String>
    • remove

      @Deprecated String remove(Object key)
      Deprecated.
      since 1.1
      In the next version, Scopes will no longer extends Map, this method will no longer be present. Use removeScope(String) instead.
      Specified by:
      remove in interface Map<String,String>