yangys
2024-04-07 a87afa1be0961724a05cdf14321f0d8fd55efb98
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package com.qianwen.core.notify.event;
 
import java.util.Map;
import javax.annotation.Nullable;
import com.qianwen.core.notify.NotifyType;
import com.qianwen.core.notify.Provider;
import com.qianwen.core.notify.template.Template;
import com.qianwen.core.tool.utils.StringUtil;
 
/* loaded from: blade-starter-notify-9.3.0.0-SNAPSHOT.jar:org/springblade/core/notify/event/NotifierEvent.class */
public class NotifierEvent {
    private boolean success;
    @Nullable
    private Throwable cause;
    private String traceId;
    private String notifierId;
    private NotifyType notifyType;
    private Provider provider;
    private String templateId;
    private Template template;
    private Map<String, Object> context;
 
    /* loaded from: blade-starter-notify-9.3.0.0-SNAPSHOT.jar:org/springblade/core/notify/event/NotifierEvent$NotifierEventBuilder.class */
    public static class NotifierEventBuilder {
        private boolean success;
        private Throwable cause;
        private String traceId;
        private String notifierId;
        private NotifyType notifyType;
        private Provider provider;
        private String templateId;
        private Template template;
        private Map<String, Object> context;
 
        NotifierEventBuilder() {
        }
 
        public NotifierEventBuilder success(final boolean success) {
            this.success = success;
            return this;
        }
 
        public NotifierEventBuilder cause(@Nullable final Throwable cause) {
            this.cause = cause;
            return this;
        }
 
        public NotifierEventBuilder traceId(final String traceId) {
            this.traceId = traceId;
            return this;
        }
 
        public NotifierEventBuilder notifierId(final String notifierId) {
            this.notifierId = notifierId;
            return this;
        }
 
        public NotifierEventBuilder notifyType(final NotifyType notifyType) {
            this.notifyType = notifyType;
            return this;
        }
 
        public NotifierEventBuilder provider(final Provider provider) {
            this.provider = provider;
            return this;
        }
 
        public NotifierEventBuilder templateId(final String templateId) {
            this.templateId = templateId;
            return this;
        }
 
        public NotifierEventBuilder template(final Template template) {
            this.template = template;
            return this;
        }
 
        public NotifierEventBuilder context(final Map<String, Object> context) {
            this.context = context;
            return this;
        }
 
        public NotifierEvent build() {
            return new NotifierEvent(this.success, this.cause, this.traceId, this.notifierId, this.notifyType, this.provider, this.templateId, this.template, this.context);
        }
 
        public String toString() {
            return "NotifierEvent.NotifierEventBuilder(success=" + this.success + ", cause=" + this.cause + ", traceId=" + this.traceId + ", notifierId=" + this.notifierId + ", notifyType=" + this.notifyType + ", provider=" + this.provider + ", templateId=" + this.templateId + ", template=" + this.template + ", context=" + this.context + ")";
        }
    }
 
    public void setSuccess(final boolean success) {
        this.success = success;
    }
 
    public void setCause(@Nullable final Throwable cause) {
        this.cause = cause;
    }
 
    public void setTraceId(final String traceId) {
        this.traceId = traceId;
    }
 
    public void setNotifierId(final String notifierId) {
        this.notifierId = notifierId;
    }
 
    public void setNotifyType(final NotifyType notifyType) {
        this.notifyType = notifyType;
    }
 
    public void setProvider(final Provider provider) {
        this.provider = provider;
    }
 
    public void setTemplateId(final String templateId) {
        this.templateId = templateId;
    }
 
    public void setTemplate(final Template template) {
        this.template = template;
    }
 
    public void setContext(final Map<String, Object> context) {
        this.context = context;
    }
 
    NotifierEvent(final boolean success, @Nullable final Throwable cause, final String traceId, final String notifierId, final NotifyType notifyType, final Provider provider, final String templateId, final Template template, final Map<String, Object> context) {
        this.success = success;
        this.cause = cause;
        this.traceId = traceId;
        this.notifierId = notifierId;
        this.notifyType = notifyType;
        this.provider = provider;
        this.templateId = templateId;
        this.template = template;
        this.context = context;
    }
 
    public static NotifierEventBuilder builder() {
        return new NotifierEventBuilder();
    }
 
    public boolean isSuccess() {
        return this.success;
    }
 
    @Nullable
    public Throwable getCause() {
        return this.cause;
    }
 
    public String getTraceId() {
        return this.traceId;
    }
 
    public String getNotifierId() {
        return this.notifierId;
    }
 
    public NotifyType getNotifyType() {
        return this.notifyType;
    }
 
    public Provider getProvider() {
        return this.provider;
    }
 
    public String getTemplateId() {
        return this.templateId;
    }
 
    public Template getTemplate() {
        return this.template;
    }
 
    public Map<String, Object> getContext() {
        return this.context;
    }
 
    public SerializableNotifierEvent toSerializable() {
        return SerializableNotifierEvent.builder().success(this.success).traceId(this.traceId).notifierId(this.notifierId).notifyType(this.notifyType.getId()).provider(this.provider.getId()).templateId(this.templateId).template(this.template != null ? this.template.toString() : "").context(this.context).cause(this.cause != null ? StringUtil.throwable2String(this.cause) : "").errorType(this.cause != null ? this.cause.getClass().getName() : null).build();
    }
 
    public String toString() {
        return "NotifierEvent.NotifierEventBuilder(success=" + this.success + ", cause=" + (this.cause != null ? StringUtil.throwable2String(this.cause) : "") + ", traceId=" + this.traceId + ", notifierId=" + this.notifierId + ", notifyType=" + this.notifyType + ", provider=" + this.provider + ", templateId=" + this.templateId + ", template=" + (this.template != null ? this.template.toString() : "") + ", context=" + this.context + ")";
    }
}