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  public class ManagedFile {
22  
23      private final String   fileName;
24      private final Metadata metadata;
25  
26      public ManagedFile(final String fileName, final Metadata metadata) {
27          this.fileName = fileName;
28          this.metadata = metadata;
29      }
30  
31      @Override
32      public boolean equals(final Object o) {
33          if (o == this)
34              return true;
35          if (!(o instanceof ManagedFile))
36              return false;
37          final ManagedFile managedFile = (ManagedFile) o;
38          return Objects.equals(fileName, managedFile.fileName)
39              && Objects.equals(metadata, managedFile.metadata);
40      }
41  
42      public String getFilename() {
43          return fileName;
44      }
45  
46      public Metadata getMetadata() {
47          return metadata;
48      }
49  
50      @Override
51      public int hashCode() {
52          final int prime = 31;
53          int result = 1;
54          result =
55              prime * result + (fileName == null ? 0 : fileName.hashCode());
56          return result;
57      }
58  
59      @Override
60      public String toString() {
61          return "managedFile ["
62              + " fileName=" + fileName
63              + " metadata=" + metadata
64              + " ]";
65      }
66  }