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