Class MapClaims

  • All Implemented Interfaces:
    Claims

    public class MapClaims
    extends java.lang.Object
    implements Claims
    A Claims implementation backed by a Map.
    Since:
    1.1.0
    Author:
    Sergio del Amo
    • Constructor Summary

      Constructors 
      Constructor Description
      MapClaims​(java.util.Map<java.lang.String,​java.lang.Object> m)
      Creates a MapClaims with the corresponding backing map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String claimName)  
      java.lang.Object get​(java.lang.String claimName)
      Retrieves a value from the claims for the given name.
      java.util.Set<java.lang.String> names()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapClaims

        public MapClaims​(java.util.Map<java.lang.String,​java.lang.Object> m)
        Creates a MapClaims with the corresponding backing map.
        Parameters:
        m - is the backing map
    • Method Detail

      • get

        @Nullable
        public java.lang.Object get​(java.lang.String claimName)
        Description copied from interface: Claims
        Retrieves a value from the claims for the given name.
        Specified by:
        get in interface Claims
        Parameters:
        claimName - the claim name
        Returns:
        null if the claim not exist or the claim value.
      • names

        @Nonnull
        public java.util.Set<java.lang.String> names()
        Specified by:
        names in interface Claims
        Returns:
        All claim names.
      • contains

        public boolean contains​(java.lang.String claimName)
        Specified by:
        contains in interface Claims
        Parameters:
        claimName - the claim name
        Returns:
        false if the claim does not exist.