001package com.nimbusds.oauth2.sdk.id; 002 003 004import java.util.UUID; 005 006import net.jcip.annotations.Immutable; 007 008 009/** 010 * Identifier for an OAuth 2.0 client software. 011 * 012 * <p>Related specifications: 013 * 014 * <ul> 015 * <li>OAuth 2.0 Dynamic Client Registration Protocol 016 * (draft-ietf-oauth-dyn-reg-14), section 2. 017 * </ul> 018 */ 019@Immutable 020public final class SoftwareID extends Identifier { 021 022 023 /** 024 * Creates a new OAuth 2.0 client software identifier with the 025 * specified value. 026 * 027 * @param value The software identifier value. Must not be {@code null} 028 * or empty string. 029 */ 030 public SoftwareID(final String value) { 031 032 super(value); 033 } 034 035 036 /** 037 * Creates a new OAuth 2.0 client software that is a type 4 UUID. 038 */ 039 public SoftwareID() { 040 041 this(UUID.randomUUID().toString()); 042 } 043 044 045 @Override 046 public boolean equals(final Object object) { 047 048 return object instanceof SoftwareID && 049 this.toString().equals(object.toString()); 050 } 051}