2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright (C) 2018 IBM.
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.so.adapters.vdu;
25 import org.apache.commons.lang3.builder.HashCodeBuilder;
26 import org.apache.commons.lang3.builder.EqualsBuilder;
28 public class VduArtifact {
30 // Enumerate the types of artifacts permitted. This may need to be a variable string
31 // value if arbitrary (cloud-specific) artifacts may be attached to VDUs in ASDC.
32 public enum ArtifactType {
33 MAIN_TEMPLATE, NESTED_TEMPLATE, CONFIG_FILE, SCRIPT_FILE, TEXT_FILE, ENVIRONMENT
37 private byte[] content;
38 private ArtifactType type;
41 public boolean equals(final Object other) {
42 if (!(other instanceof VduArtifact)) {
45 VduArtifact castOther = (VduArtifact) other;
46 return new EqualsBuilder().append(name, castOther.name).append(content, castOther.content)
47 .append(type, castOther.type).isEquals();
51 public int hashCode() {
52 return new HashCodeBuilder().append(name).append(content).append(type).toHashCode();
55 // Default constructor
56 public VduArtifact() {}
58 // Fully specified constructor
59 public VduArtifact (String name, byte[] content, ArtifactType type) {
61 this.content = content;
65 public String getName() {
68 public void setName (String name) {
71 public byte[] getContent() {
74 public void setContent(byte[] content) {
75 this.content = content;
77 public ArtifactType getType() {
80 public void setType(ArtifactType type) {