Record Class HttpSmsConfig

java.lang.Object
java.lang.Record
cloud.opencode.base.sms.config.HttpSmsConfig
Record Components:
name - the provider name | 提供商名称
apiUrl - the API URL | API地址
appId - the app ID | 应用ID
appKey - the app key | 应用密钥
signName - the sign name | 签名名称
extra - extra configuration | 额外配置

public record HttpSmsConfig(String name, String apiUrl, String appId, String appKey, String signName, Map<String,String> extra) extends Record
HTTP SMS Config HTTP短信配置

Configuration for HTTP-based SMS providers.

基于HTTP的短信提供商配置。

Features | 主要功能:

  • HTTP-based SMS provider configuration - 基于HTTP的短信提供商配置
  • Builder pattern for construction - 构建器模式构建
  • Configuration validation check - 配置验证检查

Usage Examples | 使用示例:

HttpSmsConfig config = HttpSmsConfig.builder()
    .name("myProvider")
    .apiUrl("https://sms-api.example.com/send")
    .appId("appId").appKey("appKey")
    .signName("MySign")
    .build();

Security | 安全性:

  • Thread-safe: Yes (immutable record) - 线程安全: 是(不可变记录)
  • Null-safe: Yes - 空值安全: 是
Since:
JDK 25, opencode-base-sms V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • HttpSmsConfig

      public HttpSmsConfig(String name, String apiUrl, String appId, String appKey, String signName, Map<String,String> extra)
      Creates an instance of a HttpSmsConfig record class.
      Parameters:
      name - the value for the name record component
      apiUrl - the value for the apiUrl record component
      appId - the value for the appId record component
      appKey - the value for the appKey record component
      signName - the value for the signName record component
      extra - the value for the extra record component
  • Method Details

    • builder

      public static HttpSmsConfig.Builder builder()
      Create builder 创建构建器
      Returns:
      the builder | 构建器
    • isConfigured

      public boolean isConfigured()
      Check if configured 检查是否已配置
      Returns:
      true if configured | 如果已配置返回true
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • apiUrl

      public String apiUrl()
      Returns the value of the apiUrl record component.
      Returns:
      the value of the apiUrl record component
    • appId

      public String appId()
      Returns the value of the appId record component.
      Returns:
      the value of the appId record component
    • appKey

      public String appKey()
      Returns the value of the appKey record component.
      Returns:
      the value of the appKey record component
    • signName

      public String signName()
      Returns the value of the signName record component.
      Returns:
      the value of the signName record component
    • extra

      public Map<String,String> extra()
      Returns the value of the extra record component.
      Returns:
      the value of the extra record component