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.ArrayList;
10  import java.util.Collections;
11  import java.util.HashMap;
12  import java.util.List;
13  import java.util.Map;
14  import java.util.Objects;
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  import org.codehaus.plexus.util.xml.Xpp3Dom;
21  
22  @Generated
23  public class ReportSet
24      extends ConfigurationContainer
25      implements Serializable, Cloneable
26  {
27  
28      public ReportSet() {
29          this(org.apache.maven.api.model.ReportSet.newInstance());
30      }
31  
32      public ReportSet(org.apache.maven.api.model.ReportSet delegate) {
33          this(delegate, null);
34      }
35  
36      public ReportSet(org.apache.maven.api.model.ReportSet delegate, BaseObject parent) {
37          super(delegate, parent);
38      }
39  
40      public ReportSet clone(){
41          return new ReportSet(getDelegate());
42      }
43  
44      @Override
45      public org.apache.maven.api.model.ReportSet getDelegate() {
46          return (org.apache.maven.api.model.ReportSet) super.getDelegate();
47      }
48  
49      @Override
50      public boolean equals(Object o) {
51          if (this == o) {
52              return true;
53          }
54          if (o == null || !(o instanceof ReportSet)) {
55              return false;
56          }
57          ReportSet that = (ReportSet) o;
58          return Objects.equals(this.delegate, that.delegate);
59      }
60  
61      @Override
62      public int hashCode() {
63          return getDelegate().hashCode();
64      }
65  
66      public String getId() {
67          return getDelegate().getId();
68      }
69  
70      public void setId(String id) {
71          if (!Objects.equals(id, getId())) {
72              update(getDelegate().withId(id));
73          }
74      }
75  
76      @Nonnull
77      public List<String> getReports() {
78          return new WrapperList<String, String>(() -> getDelegate().getReports(), this::setReports, s -> s, s -> s);
79      }
80  
81      public void setReports(List<String> reports) {
82          if (!Objects.equals(reports, getReports())) {
83              update(getDelegate().withReports(reports));
84          }
85      }
86  
87      public void addReport(String report) {
88          update(getDelegate().withReports(
89                 Stream.concat(getDelegate().getReports().stream(), Stream.of(report))
90                          .collect(Collectors.toList())));
91      }
92  
93      public void removeReport(String report) {
94          update(getDelegate().withReports(
95                 getDelegate().getReports().stream()
96                          .filter(e -> !Objects.equals(e, report))
97                          .collect(Collectors.toList())));
98      }
99  
100     public InputLocation getLocation(Object key) {
101         org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
102         return loc != null ? new InputLocation(loc) : null;
103     }
104 
105     public void setLocation(Object key, InputLocation location) {
106         update(org.apache.maven.api.model.ReportSet.newBuilder(getDelegate(), true)
107                         .location(key, location.toApiLocation()).build());
108     }
109 
110     public InputLocation getImportedFrom() {
111         org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
112         return loc != null ? new InputLocation(loc) : null;
113     }
114 
115     public void setImportedFrom(InputLocation location) {
116         update(org.apache.maven.api.model.ReportSet.newBuilder(getDelegate(), true)
117                         .importedFrom(location.toApiLocation()).build());
118     }
119 
120     public Set<Object> getLocationKeys() {
121         return getDelegate().getLocationKeys();
122     }
123 
124     protected boolean replace(Object oldDelegate, Object newDelegate) {
125         if (super.replace(oldDelegate, newDelegate)) {
126             return true;
127         }
128         return false;
129     }
130 
131     public static List<org.apache.maven.api.model.ReportSet> reportSetToApiV4(List<ReportSet> list) {
132         return list != null ? new WrapperList<>(list, ReportSet::getDelegate, ReportSet::new) : null;
133     }
134 
135     public static List<ReportSet> reportSetToApiV3(List<org.apache.maven.api.model.ReportSet> list) {
136         return list != null ? new WrapperList<>(list, ReportSet::new, ReportSet::getDelegate) : null;
137     }
138 
139 
140             
141     @Override
142     public String toString() {
143         return getId();
144     }
145             
146           
147 }