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