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