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. This class is immutable.
011 *
012 * @author Vladimir Dzhuvinov
013 */
014@Immutable
015public final class AccessTokenType extends Identifier {
016
017        
018        /**
019         * Bearer, see OAuth 2.0 Bearer Token Usage (RFC 6750).
020         */
021        public static final AccessTokenType BEARER = new AccessTokenType("Bearer");
022        
023        
024        /**
025         * MAC, see OAuth 2.0 Message Authentication Code (MAC) Tokens 
026         * (draft-ietf-oauth-v2-http-mac-02).
027         */
028        public static final AccessTokenType MAC = new AccessTokenType("mac");
029
030
031        /**
032         * Unknown.
033         */
034        public static final AccessTokenType UNKNOWN = new AccessTokenType("unknown");
035
036
037        /**
038         * Creates a new access token type with the specified value.
039         *
040         * @param value The access token type value. Must not be {@code null} 
041         *              or empty string.
042         */
043        public AccessTokenType(final String value) {
044
045                super(value);
046        }
047
048
049        @Override
050        public boolean equals(final Object object) {
051        
052                return object instanceof AccessTokenType &&
053                       this.toString().equals(object.toString());
054        }
055}