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