1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package com.sundata.internalevaluation.script.model;
- import cn.hutool.core.util.StrUtil;
- import org.jetbrains.annotations.Nullable;
- import java.util.Objects;
- import java.util.StringJoiner;
- public class TemplateModel {
- private String templateId;
- private String templateStr;
- @Override
- public String toString() {
- return new StringJoiner(", ", TemplateModel.class.getSimpleName() + "[", "]")
- .add("templateId='" + templateId + "'")
- .add("templateStr='" + templateStr + "'")
- .toString();
- }
- @Override
- public boolean equals(Object o) {
- if (o == null || getClass() != o.getClass()) return false;
- TemplateModel templateModel = (TemplateModel) o;
- return Objects.equals(getTemplateId(), templateModel.getTemplateId()) && Objects.equals(getTemplateStr(), templateModel.getTemplateStr());
- }
- @Override
- public int hashCode() {
- int result = Objects.hashCode(getTemplateId());
- result = 31 * result + Objects.hashCode(getTemplateStr());
- return result;
- }
- public String getTemplateId() {
- return templateId;
- }
- public void setTemplateId(String templateId) {
- this.templateId = templateId;
- }
- public String getTemplateStr() {
- return templateStr;
- }
- public void setTemplateStr(String templateStr) {
- this.templateStr = templateStr;
- }
- public TemplateModel(@Nullable String templateId,@Nullable String templateStr) {
- if(StrUtil.isEmpty(templateStr)) {
- throw new IllegalArgumentException("模板内容为空,我滴妈你想干啥!");
- }
- if(StrUtil.isEmpty(templateId)) {
- throw new IllegalArgumentException("模板ID为空,我滴妈你想干啥!");
- }
- this.templateId = templateId;
- this.templateStr = templateStr;
- }
- }
|