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