1
2
3
4 package org.apache.maven.model;
5
6 import java.io.Serializable;
7 import java.util.AbstractList;
8 import java.util.Collections;
9 import java.util.HashMap;
10 import java.util.List;
11 import java.util.Map;
12 import java.util.Objects;
13 import java.util.stream.Collectors;
14 import java.util.stream.Stream;
15 import org.apache.maven.api.annotations.Generated;
16 import org.apache.maven.api.annotations.Nonnull;
17
18 @Generated
19 public class License
20 extends BaseObject
21 {
22
23 public License()
24 {
25 this( org.apache.maven.api.model.License.newInstance() );
26 }
27
28 public License( org.apache.maven.api.model.License delegate )
29 {
30 this( delegate, null );
31 }
32
33 public License( org.apache.maven.api.model.License delegate, BaseObject parent )
34 {
35 super( delegate, parent );
36 }
37
38 public License clone()
39 {
40 return new License( getDelegate() );
41 }
42
43 public org.apache.maven.api.model.License getDelegate()
44 {
45 return ( org.apache.maven.api.model.License ) super.getDelegate();
46 }
47
48 public String getName()
49 {
50 return getDelegate().getName();
51 }
52
53 public void setName( String name )
54 {
55 if ( !Objects.equals( name, getDelegate().getName() ) )
56 {
57 update( getDelegate().withName( name ) );
58 }
59 }
60
61 public String getUrl()
62 {
63 return getDelegate().getUrl();
64 }
65
66 public void setUrl( String url )
67 {
68 if ( !Objects.equals( url, getDelegate().getUrl() ) )
69 {
70 update( getDelegate().withUrl( url ) );
71 }
72 }
73
74 public String getDistribution()
75 {
76 return getDelegate().getDistribution();
77 }
78
79 public void setDistribution( String distribution )
80 {
81 if ( !Objects.equals( distribution, getDelegate().getDistribution() ) )
82 {
83 update( getDelegate().withDistribution( distribution ) );
84 }
85 }
86
87 public String getComments()
88 {
89 return getDelegate().getComments();
90 }
91
92 public void setComments( String comments )
93 {
94 if ( !Objects.equals( comments, getDelegate().getComments() ) )
95 {
96 update( getDelegate().withComments( comments ) );
97 }
98 }
99
100 public InputLocation getLocation( Object key )
101 {
102 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
103 return loc != null ? new InputLocation( loc ) : null;
104 }
105
106 public void setLocation( Object key, InputLocation location )
107 {
108 update( org.apache.maven.api.model.License.newBuilder( getDelegate(), true )
109 .location( key, location.toApiLocation() ).build() );
110 }
111
112 protected boolean replace( Object oldDelegate, Object newDelegate )
113 {
114 if ( super.replace( oldDelegate, newDelegate ) )
115 {
116 return true;
117 }
118 return false;
119 }
120
121 public static List<org.apache.maven.api.model.License> licenseToApiV4( List<License> list )
122 {
123 return list != null ? new WrapperList<>( list, License::getDelegate, License::new ) : null;
124 }
125
126 public static List<License> licenseToApiV3( List<org.apache.maven.api.model.License> list )
127 {
128 return list != null ? new WrapperList<>( list, License::new, License::getDelegate ) : null;
129 }
130
131 }