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.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 Exclusion
21 extends BaseObject
22 {
23
24 public Exclusion()
25 {
26 this( org.apache.maven.api.model.Exclusion.newInstance() );
27 }
28
29 public Exclusion( org.apache.maven.api.model.Exclusion delegate )
30 {
31 this( delegate, null );
32 }
33
34 public Exclusion( org.apache.maven.api.model.Exclusion delegate, BaseObject parent )
35 {
36 super( delegate, parent );
37 }
38
39 public Exclusion clone()
40 {
41 return new Exclusion( getDelegate() );
42 }
43
44 public org.apache.maven.api.model.Exclusion getDelegate()
45 {
46 return ( org.apache.maven.api.model.Exclusion ) super.getDelegate();
47 }
48
49 @Override
50 public boolean equals( Object o )
51 {
52 if ( this == o )
53 {
54 return true;
55 }
56 if ( o == null || !( o instanceof Exclusion ) )
57 {
58 return false;
59 }
60 Exclusion that = ( Exclusion ) o;
61 return Objects.equals( this.delegate, that.delegate );
62 }
63
64 @Override
65 public int hashCode()
66 {
67 return getDelegate().hashCode();
68 }
69
70 public String getGroupId()
71 {
72 return getDelegate().getGroupId();
73 }
74
75 public void setGroupId( String groupId )
76 {
77 if ( !Objects.equals( groupId, getDelegate().getGroupId() ) )
78 {
79 update( getDelegate().withGroupId( groupId ) );
80 }
81 }
82
83 public String getArtifactId()
84 {
85 return getDelegate().getArtifactId();
86 }
87
88 public void setArtifactId( String artifactId )
89 {
90 if ( !Objects.equals( artifactId, getDelegate().getArtifactId() ) )
91 {
92 update( getDelegate().withArtifactId( artifactId ) );
93 }
94 }
95
96 public InputLocation getLocation( Object key )
97 {
98 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
99 return loc != null ? new InputLocation( loc ) : null;
100 }
101
102 public void setLocation( Object key, InputLocation location )
103 {
104 update( org.apache.maven.api.model.Exclusion.newBuilder( getDelegate(), true )
105 .location( key, location.toApiLocation() ).build() );
106 }
107
108 protected boolean replace( Object oldDelegate, Object newDelegate )
109 {
110 if ( super.replace( oldDelegate, newDelegate ) )
111 {
112 return true;
113 }
114 return false;
115 }
116
117 public static List<org.apache.maven.api.model.Exclusion> exclusionToApiV4( List<Exclusion> list )
118 {
119 return list != null ? new WrapperList<>( list, Exclusion::getDelegate, Exclusion::new ) : null;
120 }
121
122 public static List<Exclusion> exclusionToApiV3( List<org.apache.maven.api.model.Exclusion> list )
123 {
124 return list != null ? new WrapperList<>( list, Exclusion::new, Exclusion::getDelegate ) : null;
125 }
126
127 }