/**
 * ****************************************************************************
 * (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License v2.0 which accompany this distribution.
 * <p/>
 * The Apache License is available at
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p/>
 * *****************************************************************************
 */
package io.cloudslang.lang.entities;

import io.cloudslang.lang.entities.bindings.values.Value;
import io.cloudslang.lang.entities.bindings.values.ValueFactory;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * @author Bonczidai Levente
 * @since 1/26/2016
 */
public class SystemProperty implements Serializable {

    private final String namespace;
    private final String fullyQualifiedName;
    private final Value value;

    public SystemProperty(String namespace, String key, String value, boolean sensitive) {
        Validate.notNull(namespace, "System property namespace cannot be null");
        Validate.notEmpty(key, "System property key cannot be empty");

        String fullyQualifiedName;
        if (StringUtils.isNotEmpty(namespace)) {
            fullyQualifiedName = namespace + ScoreLangConstants.NAMESPACE_DELIMITER + key;
        } else {
            fullyQualifiedName = key;
        }

        this.namespace = namespace;
        this.fullyQualifiedName = fullyQualifiedName;
        this.value = ValueFactory.create(value, sensitive);
    }

    public SystemProperty(String namespace, String key, String value) {
        this(namespace, key, value, false);
    }

    public SystemProperty(String key, String value) {
        this("", key, value);
    }

    /**
     * only here to satisfy serialization libraries
     */
    @SuppressWarnings("unused")
    private SystemProperty() {
        namespace = null;
        fullyQualifiedName = null;
        value = null;
    }

    public String getNamespace() {
        return namespace;
    }

    public String getFullyQualifiedName() {
        return fullyQualifiedName;
    }

    public Value getValue() {
        return value;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("namespace", namespace)
                .append("fullyQualifiedName", fullyQualifiedName)
                .append("value", value)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        SystemProperty that = (SystemProperty) o;

        return new EqualsBuilder()
                .append(namespace, that.namespace)
                .append(fullyQualifiedName, that.fullyQualifiedName)
                .append(value, that.value)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(namespace)
                .append(fullyQualifiedName)
                .append(value)
                .toHashCode();
    }

}

@@ -1226,38 +1226,18 @@
 ey, 
-String value, boolean sensitiv
+Value valu
 e) %7B
@@ -1627,24 +1627,111 @@
 %0A        %7D%0A%0A
+        if (value == null) %7B%0A            value = ValueFactory.create(null);%0A        %7D%0A%0A
         this
@@ -1824,24 +1824,158 @@
 this.value =
+ value;%0A    %7D%0A%0A    public SystemProperty(String namespace, String key, String value, boolean sensitive) %7B%0A        this(namespace, key,
  ValueFactor
@@ -2000,16 +2000,17 @@
 nsitive)
+)
 ;%0A    %7D%0A
@@ -3608,11 +3608,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Add SystemProperty constructor that takes a Value object