001package com.nimbusds.oauth2.sdk.token;
002
003
004import net.jcip.annotations.Immutable;
005
006import com.nimbusds.oauth2.sdk.id.Identifier;
007
008
009/**
010 * Access token type.
011 */
012@Immutable
013public final class AccessTokenType extends Identifier {
014
015        
016        /**
017         * Bearer, see OAuth 2.0 Bearer Token Usage (RFC 6750).
018         */
019        public static final AccessTokenType BEARER = new AccessTokenType("Bearer");
020        
021        
022        /**
023         * MAC, see OAuth 2.0 Message Authentication Code (MAC) Tokens 
024         * (draft-ietf-oauth-v2-http-mac-04).
025         */
026        public static final AccessTokenType MAC = new AccessTokenType("mac");
027
028
029        /**
030         * Unknown.
031         */
032        public static final AccessTokenType UNKNOWN = new AccessTokenType("unknown");
033
034
035        /**
036         * Creates a new access token type with the specified value.
037         *
038         * @param value The access token type value. Must not be {@code null} 
039         *              or empty string.
040         */
041        public AccessTokenType(final String value) {
042
043                super(value);
044        }
045
046
047        @Override
048        public boolean equals(final Object object) {
049        
050                return object instanceof AccessTokenType &&
051                       this.toString().equals(object.toString());
052        }
053}