/*
 * Copyright (c) 2015 Fraunhofer FOKUS
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openbaton.catalogue.nfvo;

import org.openbaton.catalogue.util.IdGenerator;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.Version;

/**
 * Created by lto on 18/05/15.
 */
@Entity
public class ConfigurationParameter implements Serializable {
  @Id private String id;
  @Version private int version;

  private String confKey;
  private String value;

  @Override
  public String toString() {
    return "ConfigurationParameter{"
        + "id='"
        + id
        + '\''
        + ", version="
        + version
        + ", confKey='"
        + confKey
        + '\''
        + ", value='"
        + value
        + '\''
        + ", description='"
        + description
        + '\''
        + '}';
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  private String description;

  @PrePersist
  public void ensureId() {
    id = IdGenerator.createUUID();
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public int getVersion() {
    return version;
  }

  public void setVersion(int version) {
    this.version = version;
  }

  public String getConfKey() {
    return confKey;
  }

  public void setConfKey(String confKey) {
    this.confKey = confKey;
  }

  public String getValue() {
    return value;
  }

  public void setValue(String value) {
    this.value = value;
  }
}

@@ -689,38 +689,8 @@
 r;%0A%0A
-import java.io.Serializable;%0A%0A
 impo
@@ -718,16 +718,16 @@
 Entity;%0A
+
 import j
@@ -817,16 +817,45 @@
 Version;
+%0Aimport java.io.Serializable;
 %0A%0A/**%0A *
@@ -1070,554 +1070,8 @@
 e;%0A%0A
-  @Override%0A  public String toString() %7B%0A    return %22ConfigurationParameter%7B%22%0A        + %22id='%22%0A        + id%0A        + '%5C''%0A        + %22, version=%22%0A        + version%0A        + %22, confKey='%22%0A        + confKey%0A        + '%5C''%0A        + %22, value='%22%0A        + value%0A        + '%5C''%0A        + %22, description='%22%0A        + description%0A        + '%5C''%0A        + '%7D';%0A  %7D%0A%0A  public String getDescription() %7B%0A    return description;%0A  %7D%0A%0A  public void setDescription(String description) %7B%0A    this.description = description;%0A  %7D%0A%0A  private String description;%0A%0A
   @P
@@ -1594,24 +1594,24 @@
 ng value) %7B%0A
-
     this.val
@@ -1625,11 +1625,305 @@
 lue;%0A  %7D
+%0A%0A  @Override%0A  public String toString() %7B%0A    return %22ConfigurationParameter%7B%22%0A        + %22id='%22%0A        + id%0A        + '%5C''%0A        + %22, version=%22%0A        + version%0A        + %22, confKey='%22%0A        + confKey%0A        + '%5C''%0A        + %22, value='%22%0A        + value%0A        + '%5C''%0A        + '%7D';%0A  %7D
 %0A%7D%0A

Revert "Fea: add description to configuration parameter"