Class BasicHeader

  • All Implemented Interfaces:
    Header

    class BasicHeader
    extends java.lang.Object
    implements Header
    The BasicHeader class implements the Header interface.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String algorithm  
      private java.lang.String contentType  
      private java.lang.String keyId  
      private com.fasterxml.jackson.databind.ObjectReader objectReader  
      private java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> tree  
      private java.lang.String type  
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicHeader​(java.lang.String algorithm, java.lang.String type, java.lang.String contentType, java.lang.String keyId, java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> tree, com.fasterxml.jackson.databind.ObjectReader objectReader)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAlgorithm()
      Getter for the Algorithm "alg" claim defined in the JWT's Header.
      java.lang.String getContentType()
      Getter for the Content Type "cty" claim defined in the JWT's Header.
      Claim getHeaderClaim​(java.lang.String name)
      Get a Private Claim given it's name.
      java.lang.String getKeyId()
      Get the value of the "kid" claim, or null if it's not available.
      (package private) java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> getTree()  
      java.lang.String getType()
      Getter for the Type "typ" claim defined in the JWT's Header.
      • Methods inherited from class java.lang.Object

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

      • algorithm

        private final java.lang.String algorithm
      • type

        private final java.lang.String type
      • contentType

        private final java.lang.String contentType
      • keyId

        private final java.lang.String keyId
      • tree

        private final java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> tree
      • objectReader

        private final com.fasterxml.jackson.databind.ObjectReader objectReader
    • Constructor Detail

      • BasicHeader

        BasicHeader​(java.lang.String algorithm,
                    java.lang.String type,
                    java.lang.String contentType,
                    java.lang.String keyId,
                    java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> tree,
                    com.fasterxml.jackson.databind.ObjectReader objectReader)
    • Method Detail

      • getTree

        java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> getTree()
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Description copied from interface: Header
        Getter for the Algorithm "alg" claim defined in the JWT's Header. If the claim is missing it will return null.
        Specified by:
        getAlgorithm in interface Header
        Returns:
        the Algorithm defined or null.
      • getType

        public java.lang.String getType()
        Description copied from interface: Header
        Getter for the Type "typ" claim defined in the JWT's Header. If the claim is missing it will return null.
        Specified by:
        getType in interface Header
        Returns:
        the Type defined or null.
      • getContentType

        public java.lang.String getContentType()
        Description copied from interface: Header
        Getter for the Content Type "cty" claim defined in the JWT's Header. If the claim is missing it will return null.
        Specified by:
        getContentType in interface Header
        Returns:
        the Content Type defined or null.
      • getKeyId

        public java.lang.String getKeyId()
        Description copied from interface: Header
        Get the value of the "kid" claim, or null if it's not available.
        Specified by:
        getKeyId in interface Header
        Returns:
        the Key ID value or null.
      • getHeaderClaim

        public Claim getHeaderClaim​(java.lang.String name)
        Description copied from interface: Header
        Get a Private Claim given it's name. If the Claim wasn't specified in the Header, a NullClaim will be returned.
        Specified by:
        getHeaderClaim in interface Header
        Parameters:
        name - the name of the Claim to retrieve.
        Returns:
        a non-null Claim.