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