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 | 应用IDappKey- 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHTTP SMS Config Builder HTTP短信配置构建器 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapiUrl()Returns the value of theapiUrlrecord component.appId()Returns the value of theappIdrecord component.appKey()Returns the value of theappKeyrecord component.static HttpSmsConfig.Builderbuilder()Create builder 创建构建器final booleanIndicates whether some other object is "equal to" this one.extra()Returns the value of theextrarecord component.final inthashCode()Returns a hash code value for this object.booleanCheck if configured 检查是否已配置name()Returns the value of thenamerecord component.signName()Returns the value of thesignNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HttpSmsConfig
public HttpSmsConfig(String name, String apiUrl, String appId, String appKey, String signName, Map<String, String> extra) Creates an instance of aHttpSmsConfigrecord class.- Parameters:
name- the value for thenamerecord componentapiUrl- the value for theapiUrlrecord componentappId- the value for theappIdrecord componentappKey- the value for theappKeyrecord componentsignName- the value for thesignNamerecord componentextra- the value for theextrarecord component
-
-
Method Details
-
builder
-
isConfigured
public boolean isConfigured()Check if configured 检查是否已配置- Returns:
- true if configured | 如果已配置返回true
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
name
-
apiUrl
-
appId
-
appKey
-
signName
-
extra
-