com.taotao.cloud.idempotent.enhance.redis.config.properties.IdempotentRedisAdapterProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of taotao-cloud-starter-idempotent Show documentation
Show all versions of taotao-cloud-starter-idempotent Show documentation
taotao-cloud-starter-idempotent
/*
* Copyright (c) 2020-2030, Shuigedeng ([email protected] & https://blog.taotaocloud.top/).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taotao.cloud.idempotent.enhance.redis.config.properties;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
/** properties */
@ConfigurationProperties(prefix = IdempotentRedisAdapterProperties.PREFIX)
public class IdempotentRedisAdapterProperties {
public static final String PREFIX = "enhance.idempotent.adapter.redis";
/** 幂等记录过期时间,默认-1 */
private long expireTime = -1;
/** 过期时间单位,默认:秒 */
private TimeUnit unit = TimeUnit.SECONDS;
/** 幂等记录key前缀(默认:idempotent:) */
private String keyPrefix = "idempotent:";
/** 幂等记录key前缀(默认是keyPrefix 拼接上data字符串) */
private String dataKeyPrefix = StringUtils.endsWith(keyPrefix, ":") ? keyPrefix + "data:" : keyPrefix + ":data:";
public long getExpireTime() {
return expireTime;
}
public void setExpireTime(long expireTime) {
this.expireTime = expireTime;
}
public TimeUnit getUnit() {
return unit;
}
public void setUnit(TimeUnit unit) {
this.unit = unit;
}
public String getKeyPrefix() {
return keyPrefix;
}
public void setKeyPrefix(String keyPrefix) {
this.keyPrefix = keyPrefix;
}
public String getDataKeyPrefix() {
return dataKeyPrefix;
}
public void setDataKeyPrefix(String dataKeyPrefix) {
this.dataKeyPrefix = dataKeyPrefix;
}
}