2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.cloudify.v3.model;
23 import java.io.IOException;
24 import java.io.Serializable;
25 import java.util.Date;
27 import com.fasterxml.jackson.annotation.JsonIgnore;
28 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.databind.ObjectMapper;
32 @JsonIgnoreProperties(ignoreUnknown = true)
33 // @JsonRootName("blueprint")
34 public class Blueprint implements Serializable {
40 private static final long serialVersionUID = 938604986548763151L;
42 @JsonProperty("created_at")
43 private Date createdAt;
45 @JsonProperty("description")
46 private String description;
51 @JsonProperty("main_file_name")
52 private String mainFileName;
55 private Map<String, Object> plan = null;
57 @JsonProperty("tenant_name")
58 private String tenantName;
60 @JsonProperty("updated_at")
61 private Date updatedAt;
63 public Date getCreatedAt() {
67 public void setCreatedAt(Date createdAt) {
68 this.createdAt = createdAt;
71 public String getDescription() {
75 public void setDescription(String description) {
76 this.description = description;
79 public String getId() {
83 public void setId(String id) {
87 public String getMainFileName() {
91 public void setMainFileName(String mainFileName) {
92 this.mainFileName = mainFileName;
95 public Map<String, Object> getPlan() {
99 public void setPlan(Map<String, Object> plan) {
103 public String getTenantName() {
107 public void setTenantName(String tenantName) {
108 this.tenantName = tenantName;
111 public Date getUpdatedAt() {
115 public void setUpdatedAt(Date updatedAt) {
116 this.updatedAt = updatedAt;
121 * Return an output as a Json-mapped Object of the provided type. This is useful for json-object outputs.
123 public <T> T getMapValue(Map<String, Object> map, String key, Class<T> type) {
125 ObjectMapper mapper = new ObjectMapper();
127 if (map.containsKey(key)) {
129 String s = mapper.writeValueAsString(map.get(key));
130 return (mapper.readValue(s, type));
131 } catch (IOException e) {
139 public String toString() {
140 return "Deployment{" + "id='" + id + '\'' + ", description='" + description + '\'' + ", createdAt=" + createdAt
141 + ", updatedAt=" + updatedAt + ", mainFileName='" + mainFileName + '\'' + ", tenantName='" + tenantName
146 * Add a definition of the Cloudify "plan" attribute once we know what it is.
148 * @JsonIgnoreProperties(ignoreUnknown=true) public static final class Plan { }