1
2
3
4
5 package org.apache.maven.model;
6
7 import java.io.Serializable;
8 import java.util.AbstractList;
9 import java.util.Collections;
10 import java.util.HashMap;
11 import java.util.List;
12 import java.util.Map;
13 import java.util.Objects;
14 import java.util.Properties;
15 import java.util.Set;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
18 import org.apache.maven.api.annotations.Generated;
19 import org.apache.maven.api.annotations.Nonnull;
20
21 @Generated
22 public class Notifier
23 extends BaseObject
24 {
25
26 public Notifier() {
27 this(org.apache.maven.api.model.Notifier.newInstance());
28 }
29
30 public Notifier(org.apache.maven.api.model.Notifier delegate) {
31 this(delegate, null);
32 }
33
34 public Notifier(org.apache.maven.api.model.Notifier delegate, BaseObject parent) {
35 super(delegate, parent);
36 }
37
38 public Notifier clone(){
39 return new Notifier(getDelegate());
40 }
41
42 public org.apache.maven.api.model.Notifier getDelegate() {
43 return (org.apache.maven.api.model.Notifier) super.getDelegate();
44 }
45
46 @Override
47 public boolean equals(Object o) {
48 if (this == o) {
49 return true;
50 }
51 if (o == null || !(o instanceof Notifier)) {
52 return false;
53 }
54 Notifier that = (Notifier) o;
55 return Objects.equals(this.delegate, that.delegate);
56 }
57
58 @Override
59 public int hashCode() {
60 return getDelegate().hashCode();
61 }
62
63 public String getType() {
64 return getDelegate().getType();
65 }
66
67 public void setType(String type) {
68 if (!Objects.equals(type, getType())) {
69 update(getDelegate().withType(type));
70 }
71 }
72
73 public boolean isSendOnError() {
74 return getDelegate().isSendOnError();
75 }
76
77 public void setSendOnError(boolean sendOnError) {
78 if (!Objects.equals(sendOnError, isSendOnError())) {
79 update(getDelegate().withSendOnError(sendOnError));
80 }
81 }
82
83 public boolean isSendOnFailure() {
84 return getDelegate().isSendOnFailure();
85 }
86
87 public void setSendOnFailure(boolean sendOnFailure) {
88 if (!Objects.equals(sendOnFailure, isSendOnFailure())) {
89 update(getDelegate().withSendOnFailure(sendOnFailure));
90 }
91 }
92
93 public boolean isSendOnSuccess() {
94 return getDelegate().isSendOnSuccess();
95 }
96
97 public void setSendOnSuccess(boolean sendOnSuccess) {
98 if (!Objects.equals(sendOnSuccess, isSendOnSuccess())) {
99 update(getDelegate().withSendOnSuccess(sendOnSuccess));
100 }
101 }
102
103 public boolean isSendOnWarning() {
104 return getDelegate().isSendOnWarning();
105 }
106
107 public void setSendOnWarning(boolean sendOnWarning) {
108 if (!Objects.equals(sendOnWarning, isSendOnWarning())) {
109 update(getDelegate().withSendOnWarning(sendOnWarning));
110 }
111 }
112
113 public String getAddress() {
114 return getDelegate().getAddress();
115 }
116
117 public void setAddress(String address) {
118 if (!Objects.equals(address, getAddress())) {
119 update(getDelegate().withAddress(address));
120 }
121 }
122
123 @Nonnull
124 public Properties getConfiguration() {
125 return new WrapperProperties(() -> getDelegate().getConfiguration(), this::setConfiguration);
126 }
127
128 public void setConfiguration(Properties configuration) {
129 Map<String, String> map = configuration.entrySet().stream()
130 .collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().toString()));
131 if (!Objects.equals(map, getDelegate().getConfiguration())) {
132 update(getDelegate().withConfiguration(map));
133 }
134 }
135
136 public void addConfiguration(String key, String value) {
137 getConfiguration().put(key, value);
138 }
139
140 public InputLocation getLocation(Object key) {
141 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
142 return loc != null ? new InputLocation(loc) : null;
143 }
144
145 public void setLocation(Object key, InputLocation location) {
146 update(org.apache.maven.api.model.Notifier.newBuilder(getDelegate(), true)
147 .location(key, location.toApiLocation()).build());
148 }
149
150 public InputLocation getImportedFrom() {
151 org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
152 return loc != null ? new InputLocation(loc) : null;
153 }
154
155 public void setImportedFrom(InputLocation location) {
156 update(org.apache.maven.api.model.Notifier.newBuilder(getDelegate(), true)
157 .importedFrom(location.toApiLocation()).build());
158 }
159
160 public Set<Object> getLocationKeys() {
161 return getDelegate().getLocationKeys();
162 }
163
164 protected boolean replace(Object oldDelegate, Object newDelegate) {
165 if (super.replace(oldDelegate, newDelegate)) {
166 return true;
167 }
168 return false;
169 }
170
171 public static List<org.apache.maven.api.model.Notifier> notifierToApiV4(List<Notifier> list) {
172 return list != null ? new WrapperList<>(list, Notifier::getDelegate, Notifier::new) : null;
173 }
174
175 public static List<Notifier> notifierToApiV3(List<org.apache.maven.api.model.Notifier> list) {
176 return list != null ? new WrapperList<>(list, Notifier::new, Notifier::getDelegate) : null;
177 }
178
179 }