export class DownloadUrl {
  private constructor(private readonly _value: string) {}

  static create(value: string): DownloadUrl {
    if (!value || value.trim().length === 0) {
      throw new Error('Download URL cannot be empty')
    }
    // 基本 URL 格式验证
    try {
      new URL(value)
    } catch {
      throw new Error('Invalid download URL format')
    }
    return new DownloadUrl(value.trim())
  }

  get value(): string {
    return this._value
  }

  equals(other: DownloadUrl): boolean {
    return this._value === other._value
  }
}
