View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   //   Generated by Maven, any modifications will be overwritten.
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  
19  @Generated
20  public class Resource
21      extends FileSet
22      implements Serializable, Cloneable
23  {
24  
25      public Resource()
26      {
27          this( org.apache.maven.api.model.Resource.newInstance() );
28      }
29  
30      public Resource( org.apache.maven.api.model.Resource delegate )
31      {
32          this( delegate, null );
33      }
34  
35      public Resource( org.apache.maven.api.model.Resource delegate, BaseObject parent )
36      {
37          super( delegate, parent );
38      }
39  
40      public Resource clone()
41      {
42          return new Resource( getDelegate() );
43      }
44  
45      @Override
46      public org.apache.maven.api.model.Resource getDelegate()
47      {
48          return ( org.apache.maven.api.model.Resource ) super.getDelegate();
49      }
50  
51      public String getTargetPath()
52      {
53          return getDelegate().getTargetPath();
54      }
55  
56      public void setTargetPath( String targetPath )
57      {
58          if ( !Objects.equals( targetPath, getDelegate().getTargetPath() ) )
59          {
60              update( getDelegate().withTargetPath( targetPath ) );
61          }
62      }
63  
64      public String getFiltering()
65      {
66          return getDelegate().getFiltering();
67      }
68  
69      public void setFiltering( String filtering )
70      {
71          if ( !Objects.equals( filtering, getDelegate().getFiltering() ) )
72          {
73              update( getDelegate().withFiltering( filtering ) );
74          }
75      }
76  
77      public String getMergeId()
78      {
79          return getDelegate().getMergeId();
80      }
81  
82      public void setMergeId( String mergeId )
83      {
84          if ( !Objects.equals( mergeId, getDelegate().getMergeId() ) )
85          {
86              update( getDelegate().withMergeId( mergeId ) );
87          }
88      }
89  
90      public InputLocation getLocation( Object key )
91      {
92          org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
93          return loc != null ? new InputLocation( loc ) : null;
94      }
95  
96      public void setLocation( Object key, InputLocation location )
97      {
98          update( org.apache.maven.api.model.Resource.newBuilder( getDelegate(), true )
99                          .location( key, location.toApiLocation() ).build() );
100     }
101 
102     protected boolean replace( Object oldDelegate, Object newDelegate )
103     {
104         if ( super.replace( oldDelegate, newDelegate ) )
105         {
106             return true;
107         }
108         return false;
109     }
110 
111     public static List<org.apache.maven.api.model.Resource> resourceToApiV4( List<Resource> list )
112     {
113         return list != null ? new WrapperList<>( list, Resource::getDelegate, Resource::new ) : null;
114     }
115 
116     public static List<Resource> resourceToApiV3( List<org.apache.maven.api.model.Resource> list )
117     {
118         return list != null ? new WrapperList<>( list, Resource::new, Resource::getDelegate ) : null;
119     }
120 
121 
122             
123     public boolean isFiltering()
124     {
125         return ( getFiltering() != null ) ? Boolean.parseBoolean( getFiltering() ) : false;
126     }
127             
128           
129 
130             
131     public void setFiltering( boolean filtering )
132     {
133         setFiltering( String.valueOf( filtering ) );
134     }
135             
136           
137 
138             
139     /**
140      * @see java.lang.Object#toString()
141      */
142     public String toString()
143     {
144         return "Resource {targetPath: " + getTargetPath() + ", filtering: " + isFiltering() + ", " + super.toString() + "}";
145     }
146             
147           
148 }