package com.peterphi.std.guice.config.rest.types;

import com.google.common.base.Objects;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;

@XmlType(name = "ConfigValueType")
public class ConfigPropertyValue
{
	/**
	 *
	 */
	@XmlAttribute
	public String path;

	@XmlAttribute
	public String name;

	@XmlValue
	public String value;


	public ConfigPropertyValue(final String path, final String name, final String value)
	{
		this.path = path;
		this.name = name;
		this.value = value;
	}


	public String getPath()
	{
		return path;
	}


	public String getName()
	{
		return name;
	}


	public String getValue()
	{
		return value;
	}


	@Override
	public String toString()
	{
		return Objects.toStringHelper(this)
		              .omitNullValues()
		              .add("path", path)
		              .add("name", name)
		              .add("value", value)
		              .toString();
	}
}

package com.peterphi.std.guice.config.rest.types;

import com.google.common.base.Objects;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;

@XmlType(name = "ConfigValueType")
public class ConfigPropertyValue
{
	public ConfigPropertyValue(){
		//default constructor for jaxb
	}

	/**
	 *
	 */
	@XmlAttribute
	public String path;

	@XmlAttribute
	public String name;

	@XmlValue
	public String value;


	public ConfigPropertyValue(final String path, final String name, final String value)
	{
		this.path = path;
		this.name = name;
		this.value = value;
	}


	public String getPath()
	{
		return path;
	}


	public String getName()
	{
		return name;
	}


	public String getValue()
	{
		return value;
	}


	@Override
	public String toString()
	{
		return Objects.toStringHelper(this)
		              .omitNullValues()
		              .add("path", path)
		              .add("name", name)
		              .add("value", value)
		              .toString();
	}
}

add default constructor unmarshalling