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