View Javadoc
1   /*
2    * Copyright 2023 Adrian Herscu
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package dev.aherscu.qa.s3.publisher.maven.plugin.config;
18  
19  import java.util.*;
20  
21  import edu.umd.cs.findbugs.annotations.*;
22  
23  @SuppressFBWarnings(
24      value = "UWF_UNWRITTEN_FIELD",
25      justification = "fields are filled in by the Maven plugin framework")
26  public class Include {
27  
28      /**
29       * The bind of a pattern with the metadata to apply to all the files
30       * matching it.
31       */
32      Bind       bind;
33  
34      /**
35       * List of binds specifying constraints in order to override metadata for a
36       * subset of files.
37       *
38       * @parameter
39       */
40      List<Bind> constraints;
41  
42      @Override
43      public boolean equals(final Object o) {
44          if (o == this)
45              return true;
46          if (!(o instanceof Include))
47              return false;
48          final Include include = (Include) o;
49          return Objects.equals(bind, include.bind)
50              && Objects.equals(constraints, include.constraints);
51      }
52  
53      public Bind getBind() {
54          return bind;
55      }
56  
57      public List<Bind> getContraints() {
58          return constraints;
59      }
60  
61      @Override
62      public int hashCode() {
63          final int prime = 31;
64          int result = 1;
65          result = prime * result + (bind == null ? 0 : bind.hashCode());
66          result = prime * result
67              + (constraints == null ? 0 : constraints.hashCode());
68          return result;
69      }
70  
71      @Override
72      public String toString() {
73          return "include ["
74              + " bind=" + bind
75              + " constraints=" + constraints
76              + " ]";
77      }
78  }