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 Bind {
27  
28      /**
29       * List of expressions matching files to include. Could be regular
30       * expressions using the expression %regex[].
31       */
32      String pattern;
33  
34      /**
35       * The id of the metadata which will be applied to all the files matching
36       * the pattern parameter.
37       *
38       * @parameter
39       * @required
40       */
41      String metadataId;
42  
43      @Override
44      public boolean equals(final Object o) {
45          if (o == this)
46              return true;
47          if (!(o instanceof Bind))
48              return false;
49          final Bind bind = (Bind) o;
50          return Objects.equals(pattern, bind.pattern)
51              && Objects.equals(metadataId, bind.metadataId);
52      }
53  
54      public String getMetadataId() {
55          return metadataId;
56      }
57  
58      public String getPattern() {
59          return pattern;
60      }
61  
62      @Override
63      public int hashCode() {
64          final int prime = 31;
65          int result = 1;
66          result = prime * result + (pattern == null ? 0 : pattern.hashCode());
67          result =
68              prime * result + (metadataId == null ? 0 : metadataId.hashCode());
69          return result;
70      }
71  
72      @Override
73      public String toString() {
74          return "bind ["
75              + " pattern=" + pattern
76              + " metadataId=" + metadataId
77              + " ]";
78      }
79  }