All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.zhxu.bp.model.DictKV Maven / Gradle / Ivy

The newest version!
package cn.zhxu.bp.model;

import cn.zhxu.bp.RespException;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author Troy.Zhou @ 2022/8/10 16:14
 */
@Getter
@Setter
@ToString
public class DictKV {

    private String ckey;
    private String value;

    public void validate() {
        if (ckey == null) {
            throw RespException.forbidden("ckey can not be null");
        }
        if (ckey.length() > 45) {
            throw RespException.forbidden("ckey.length must < 45");
        }
        if (value != null && value.length() > 10000) {
            throw RespException.forbidden("value.length must <= 10000");
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy