001package com.nimbusds.oauth2.sdk.id;
002
003
004import net.jcip.annotations.Immutable;
005
006
007/**
008 * Issuer identifier. This class is immutable.
009 *
010 * @author Vladimir Dzhuvinov
011 */
012@Immutable
013public final class Issuer extends Identifier {
014
015
016        /**
017         * Creates a new issuer identifier with the specified value.
018         *
019         * @param value The issuer identifier value. Must not be {@code null}
020         *              or empty string.
021         */
022        public Issuer(final String value) {
023
024                super(value);
025        }
026
027
028        /**
029         * Creates a new issuer identifier with a randomly generated value of 
030         * the specified byte length, Base64URL-encoded.
031         *
032         * @param byteLength The byte length of the value to generate. Must be
033         *                   greater than one.
034         */
035        public Issuer(final int byteLength) {
036        
037                super(byteLength);
038        }
039        
040        
041        /**
042         * Creates a new issuer identifier with a randomly generated 256-bit 
043         * (32-byte) value, Base64URL-encoded.
044         */
045        public Issuer() {
046
047                super();
048        }
049
050
051        @Override
052        public boolean equals(final Object object) {
053        
054                return object instanceof Issuer &&
055                       this.toString().equals(object.toString());
056        }
057}