001 package com.nimbusds.oauth2.sdk.id; 002 003 004 import net.jcip.annotations.Immutable; 005 006 007 /** 008 * Issuer identifier. This class is immutable. 009 * 010 * @author Vladimir Dzhuvinov 011 */ 012 @Immutable 013 public 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 length. The value will be made up of mixed-case 031 * alphanumeric ASCII characters. 032 * 033 * @param length The number of characters. Must be a positive integer. 034 */ 035 public Issuer(final int length) { 036 037 super(length); 038 } 039 040 041 /** 042 * Creates a new issuer identifier with a randomly generated value. The 043 * value will be made up of 32 mixed-case alphanumeric ASCII 044 * characters. 045 */ 046 public Issuer() { 047 048 super(); 049 } 050 051 052 @Override 053 public boolean equals(final Object object) { 054 055 return object != null && 056 object instanceof Issuer && 057 this.toString().equals(object.toString()); 058 } 059 }