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