Interface SecurityRequirement

  • All Superinterfaces:
    Constructible, java.util.Map<java.lang.String,​java.util.List<java.lang.String>>

    public interface SecurityRequirement
    extends Constructible, java.util.Map<java.lang.String,​java.util.List<java.lang.String>>
    SecurityRequirement
    See Also:
    SecurityRequirement Object
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      SecurityRequirement addScheme​(java.lang.String securitySchemeName)
      Adds a security scheme to the SecurityRequirement instance based on the scheme name.
      SecurityRequirement addScheme​(java.lang.String securitySchemeName, java.lang.String scope)
      Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scope (optional) provided.
      SecurityRequirement addScheme​(java.lang.String securitySchemeName, java.util.List<java.lang.String> scopes)
      Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scopes (optional) provided.
      boolean containsKey​(java.lang.Object key)
      Deprecated.
      since 1.1
      java.util.List<java.lang.String> get​(java.lang.Object key)
      Deprecated.
      since 1.1
      default java.util.List<java.lang.String> getScheme​(java.lang.String securitySchemeName)
      Returns a path item for a given name.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getSchemes()
      Returns a copy map (potentially immutable) of the schemes.
      default boolean hasScheme​(java.lang.String securitySchemeName)
      Check whether a scheme is present in the map.
      java.util.List<java.lang.String> put​(java.lang.String key, java.util.List<java.lang.String> value)
      Deprecated.
      since 1.1
      void putAll​(java.util.Map<? extends java.lang.String,​? extends java.util.List<java.lang.String>> m)
      Deprecated.
      since 1.1
      java.util.List<java.lang.String> remove​(java.lang.Object key)
      Deprecated.
      since 1.1
      void removeScheme​(java.lang.String securitySchemeName)
      Removes a security scheme to the SecurityRequirement instance based on the scheme name.
      void setSchemes​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> items)
      Set all security schemes to the SecurityRequirement instance.
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
    • Method Detail

      • addScheme

        SecurityRequirement addScheme​(java.lang.String securitySchemeName,
                                      java.lang.String scope)
        Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scope (optional) provided.
        Parameters:
        securitySchemeName - the name of security scheme declared in the Components section of the OpenAPI document
        scope - a required scope - only valid when the defined scheme is 'oauth2' or 'openIdConnect'. null values will be rejected (implementation will throw an exception) or ignored.
        Returns:
        Updated SecurityRequirement instance
      • addScheme

        SecurityRequirement addScheme​(java.lang.String securitySchemeName,
                                      java.util.List<java.lang.String> scopes)
        Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scopes (optional) provided.
        Parameters:
        securitySchemeName - the name of security scheme declared in the Components section of the OpenAPI document
        scopes - the scopes required - only valid when the defined scheme is 'oauth2' or 'openIdConnect'. null values will be rejected (implementation will throw an exception) or ignored.
        Returns:
        Updated SecurityRequirement instance
      • addScheme

        SecurityRequirement addScheme​(java.lang.String securitySchemeName)
        Adds a security scheme to the SecurityRequirement instance based on the scheme name. No scopes are included, resulting in an empty list of scopes for the security scheme. This is valid when the defined security scheme is not 'oauth2' or 'openIdConnect'.
        Parameters:
        securitySchemeName - the name of security scheme declared in the Components section of the OpenAPI document
        Returns:
        Updated SecurityRequirement instance
      • removeScheme

        void removeScheme​(java.lang.String securitySchemeName)
        Removes a security scheme to the SecurityRequirement instance based on the scheme name.
        Parameters:
        securitySchemeName - the name of security scheme
      • getSchemes

        java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getSchemes()
        Returns a copy map (potentially immutable) of the schemes.
        Returns:
        all items
      • setSchemes

        void setSchemes​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> items)
        Set all security schemes to the SecurityRequirement instance. Keys are the name of security scheme declared in the Components section of the OpenAPI document, values are a list of required scope - only valid when the defined scheme is 'oauth2' or 'openIdConnect'
        Parameters:
        items - a map containing the security schemes.
      • hasScheme

        default boolean hasScheme​(java.lang.String securitySchemeName)
        Check whether a scheme is present in the map. This is a convenience method for getSchemes().containsKey(name)
        Parameters:
        securitySchemeName - the name of security scheme
        Returns:
        a boolean to indicate if the scheme is present or not.
      • getScheme

        default java.util.List<java.lang.String> getScheme​(java.lang.String securitySchemeName)
        Returns a path item for a given name. This is a convenience method for getSchemes().get(name)
        Parameters:
        securitySchemeName - the name of security scheme
        Returns:
        the corresponding path item or null.
      • get

        @Deprecated
        java.util.List<java.lang.String> get​(java.lang.Object key)
        Deprecated.
        since 1.1
        In the next version, SecurityRequirement will no longer extends Map, this method will no longer be present. Use getScheme(String) instead.
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.util.List<java.lang.String>>
      • containsKey

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

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

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

        @Deprecated
        java.util.List<java.lang.String> remove​(java.lang.Object key)
        Deprecated.
        since 1.1
        In the next version, SecurityRequirement will no longer extends Map, this method will no longer be present. Use removeScheme(String) instead.
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.util.List<java.lang.String>>