Class MapClaims

java.lang.Object
io.micronaut.security.token.MapClaims
All Implemented Interfaces:
Claims

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

    • MapClaims

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

    • get

      @Nullable public @Nullable Object get(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 @NonNull Set<String> names()
      Specified by:
      names in interface Claims
      Returns:
      All claim names.
    • contains

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