2 * Copyright 2016 Huawei Technologies Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.vfc.nfvo.resmanagement.service.entity;
19 import org.apache.commons.lang.StringUtils;
20 import org.onap.vfc.nfvo.resmanagement.common.util.JsonUtil;
22 import net.sf.json.JSONObject;
26 * Virtualised infrastructure manager entity class.<br>
31 * @version NFVO 0.5 Sep 10, 2016
33 public class VimEntity {
36 * This field corresponds to the database column vim.ID
43 * This field corresponds to the database column vim.ID
50 * This method was generated by MyBatis Generator. This method returns the
51 * value of the database column vim.ID
53 * @return the value of vim.ID
55 public String getId() {
60 * This method was generated by MyBatis Generator. This method sets the
61 * value of the database column vim.ID
64 * the value for vim.ID
66 public void setId(String id) {
67 this.id = id == null ? null : id.trim();
70 public String getName() {
74 public void setName(String name) {
86 public static VimEntity toEntity(JSONObject jsonObject) {
87 VimEntity vimEntity = new VimEntity();
88 vimEntity.setId(JsonUtil.getJsonFieldStr(jsonObject, "id"));
89 vimEntity.setName(JsonUtil.getJsonFieldStr(jsonObject, "name"));
100 public String toString() {
101 JSONObject resJson = new JSONObject();
102 resJson.put("id", StringUtils.trimToEmpty(this.getId()));
103 resJson.put("name", StringUtils.trimToEmpty(this.getName()));
104 return resJson.toString();