Incorporate the ECOMP SDC Artefact Generator code
[aai/babel.git] / src / test / java / org / onap / aai / babel / csar / fixture / TestArtifactInfoImpl.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017-2018 European Software Marketing Ltd.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21 package org.onap.aai.babel.csar.fixture;
22
23 import java.util.Objects;
24 import org.apache.commons.lang3.builder.EqualsBuilder;
25 import org.openecomp.sdc.api.notification.IArtifactInfo;
26
27 /**
28  * This class is an implementation of IArtifactInfo for test purposes.
29  */
30 public class TestArtifactInfoImpl implements IArtifactInfo {
31
32     private String artifactName;
33     private String artifactType;
34     private String artifactDescription;
35     private String artifactVersion;
36
37     @Override
38     public String getArtifactName() {
39         return artifactName;
40     }
41
42     void setArtifactName(String artifactName) {
43         this.artifactName = artifactName;
44     }
45
46     @Override
47     public String getArtifactType() {
48         return artifactType;
49     }
50
51     void setArtifactType(String artifactType) {
52         this.artifactType = artifactType;
53     }
54
55     @Override
56     public String getArtifactURL() {
57         return null;
58     }
59
60     @Override
61     public String getArtifactChecksum() {
62         return null;
63     }
64
65     @Override
66     public String getArtifactDescription() {
67         return artifactDescription;
68     }
69
70     void setArtifactDescription(String artifactDescription) {
71         this.artifactDescription = artifactDescription;
72     }
73
74     @Override
75     public Integer getArtifactTimeout() {
76         return null;
77     }
78
79     @Override
80     public String getArtifactVersion() {
81         return artifactVersion;
82     }
83
84     void setArtifactVersion(String artifactVersion) {
85         this.artifactVersion = artifactVersion;
86     }
87
88     @Override
89     public String getArtifactUUID() {
90         return null;
91     }
92
93     @Override
94     public IArtifactInfo getGeneratedArtifact() {
95         return null;
96     }
97
98     @Override
99     public java.util.List<IArtifactInfo> getRelatedArtifacts() {
100         return null;
101     }
102
103     @Override
104     public boolean equals(Object obj) {
105         if (!(obj instanceof TestArtifactInfoImpl)) {
106             return false;
107         } else if (obj == this) {
108             return true;
109         }
110         TestArtifactInfoImpl rhs = (TestArtifactInfoImpl) obj;
111      // @formatter:off
112      return new EqualsBuilder()
113                   .append(artifactType, rhs.artifactType)
114                   .append(artifactDescription, rhs.artifactDescription)
115                   .append(artifactVersion, rhs.artifactVersion)
116                   .isEquals();
117      // @formatter:on
118     }
119
120     @Override
121     public int hashCode() {
122         return Objects.hash(this.artifactType, this.artifactDescription, this.artifactVersion);
123     }
124 }