Record Class SmsConfig
java.lang.Object
java.lang.Record
cloud.opencode.base.sms.config.SmsConfig
- Record Components:
providerType- the provider type | 提供商类型accessKey- the access key | 访问密钥secretKey- the secret key | 密钥signName- the sign name | 签名名称region- the region | 区域timeout- the timeout | 超时extraProperties- extra properties | 额外属性
public record SmsConfig(SmsProviderType providerType, String accessKey, String secretKey, String signName, String region, Duration timeout, Map<String,String> extraProperties)
extends Record
SMS Config
短信配置
Configuration for SMS provider.
短信提供商配置。
Features | 主要功能:
- Immutable record-based configuration - 基于记录的不可变配置
- Builder pattern for fluent construction - 构建器模式流畅构建
- Defensive copy of extra properties - 额外属性防御性复制
Usage Examples | 使用示例:
SmsConfig config = SmsConfig.builder()
.providerType(SmsProviderType.ALIYUN)
.accessKey("yourAccessKey")
.secretKey("yourSecretKey")
.signName("YourSign")
.region("cn-hangzhou")
.build();
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是(不可变记录)
- Null-safe: Yes (defaults applied in compact constructor) - 空值安全: 是(紧凑构造器中应用默认值)
- Since:
- JDK 25, opencode-base-sms V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for SmsConfig SmsConfig构建器 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessKeyrecord component.static SmsConfig.Builderbuilder()final booleanIndicates whether some other object is "equal to" this one.Returns the value of theextraPropertiesrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theproviderTyperecord component.region()Returns the value of theregionrecord component.Returns the value of thesecretKeyrecord component.signName()Returns the value of thesignNamerecord component.timeout()Returns the value of thetimeoutrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SmsConfig
public SmsConfig(SmsProviderType providerType, String accessKey, String secretKey, String signName, String region, Duration timeout, Map<String, String> extraProperties) Creates an instance of aSmsConfigrecord class.- Parameters:
providerType- the value for theproviderTyperecord componentaccessKey- the value for theaccessKeyrecord componentsecretKey- the value for thesecretKeyrecord componentsignName- the value for thesignNamerecord componentregion- the value for theregionrecord componenttimeout- the value for thetimeoutrecord componentextraProperties- the value for theextraPropertiesrecord component
-
-
Method Details
-
builder
-
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). -
providerType
Returns the value of theproviderTyperecord component.- Returns:
- the value of the
providerTyperecord component
-
accessKey
-
secretKey
-
signName
-
region
-
timeout
-
extraProperties
Returns the value of theextraPropertiesrecord component.- Returns:
- the value of the
extraPropertiesrecord component
-