Service Import - Input appearing as a property
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / OperationInputDefinition.java
1 /*
2  * Copyright © 2016-2018 European Support Limited
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 package org.openecomp.sdc.be.datatypes.elements;
17
18 import com.fasterxml.jackson.annotation.JsonCreator;
19 import lombok.Getter;
20 import lombok.Setter;
21 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
22
23 @Getter
24 @Setter
25 public class OperationInputDefinition extends InputDataDefinition {
26
27     private String source;
28     private String sourceProperty;
29     private String toscaDefaultValue;
30
31     @JsonCreator
32     public OperationInputDefinition() {
33         super();
34     }
35
36     public OperationInputDefinition(String name, InputDataDefinition inputDefinition, String source, String sourceProperty) {
37         super(inputDefinition);
38         setName(name);
39         setSource(source);
40         setSourceProperty(sourceProperty);
41     }
42
43     public OperationInputDefinition(OperationInputDefinition oid) {
44         super(oid);
45         setName(oid.getName());
46         setSource(oid.getSource());
47         setSourceProperty(oid.getSourceProperty());
48     }
49
50     public OperationInputDefinition(String name, String property, Boolean mandatory, String type) {
51         super();
52         setName(name);
53         setInputId(property);
54         setRequired(mandatory);
55         setType(type);
56     }
57
58     public String getLabel() {
59         return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_LABEL);
60     }
61
62     public void setLabel(String name) {
63         setToscaPresentationValue(JsonPresentationFields.ARTIFACT_LABEL, name);
64     }
65
66 }