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 * @version $version$ (2013-01-15) 012 */ 013 @Immutable 014 public final class Issuer extends Identifier { 015 016 017 /** 018 * Creates a new issuer identifier with the specified value. 019 * 020 * @param value The issuer identifier value. Must not be {@code null} 021 * or empty string. 022 */ 023 public Issuer(final String value) { 024 025 super(value); 026 } 027 028 029 /** 030 * Creates a new issuer identifier with a randomly generated value of 031 * the specified length. The value will be made up of mixed-case 032 * alphanumeric ASCII characters. 033 * 034 * @param length The number of characters. Must be a positive integer. 035 */ 036 public Issuer(final int length) { 037 038 super(length); 039 } 040 041 042 /** 043 * Creates a new issuer identifier with a randomly generated value. The 044 * value will be made up of 32 mixed-case alphanumeric ASCII 045 * characters. 046 */ 047 public Issuer() { 048 049 super(); 050 } 051 052 053 @Override 054 public boolean equals(final Object object) { 055 056 return object != null && 057 object instanceof Issuer && 058 this.toString().equals(object.toString()); 059 } 060 }