/**
 * 
 */
package com.boundary.sdk;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author davidg
 *
 */
public class Source implements Serializable {
	
	private String ref;
	private String type;
	private String name;
	private Map<String,Object> properties;

	/**
	 * 
	 */
	public Source() {
		this("","");
	}
	
	/**
	 * 
	 * @param ref
	 * @param type
	 */
	public Source(String ref, String type) {
		this(ref,type,"");
	}
	
	/**
	 * Constructor with the required parameters for an event
	 * 
	 * @param ref
	 * @param type
	 * @param name
	 */
	public Source(String ref,String type,String name) {
		this(ref,type,name,new HashMap<String,Object>());
	}

	/**
	 * 
	 * @param ref
	 * @param type
	 * @param name
	 * @param properties
	 */
	public Source(String ref, String type, String name, Map<String,Object> properties) {
		this.ref = ref;
		this.type = type;
		this.name = name;
		this.properties = properties;
	}
	
	public void setRef(String ref) {
		this.ref = ref;
	}
	
	public String getRef() {
		return this.ref;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public String getType() {
		return this.type;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
	public Map<String,Object> getProperties() {
		return properties;
	}
	
	public void setProperties(Map<String,Object> properties) {
		this.properties = properties;
	}
	
	public String toString() {
		StringBuffer s = new StringBuffer();
		s.append("ref: " + this.ref);
		s.append("type: " + this.type);
		s.append("name: " + this.name);
		s.append("properties: " + this.properties);
		return s.toString();
	}


	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}

@@ -298,24 +298,43 @@
 ;%0A%0A%09/**%0A%09 * 
+Default constructor
 %0A%09 */%0A%09publi
@@ -367,24 +367,63 @@
 ;%0A%09%7D%0A%09%0A%09/**%0A
+%09 * Constructor that uses ref and type%0A
 %09 * %0A%09 * @pa
@@ -543,50 +543,8 @@
 ctor
- with the required parameters for an event
 %0A%09 *
@@ -707,24 +707,40 @@
 );%0A%09%7D%0A%0A%09/**%0A
+%09 * Constructor%0A
 %09 * %0A%09 * @pa
@@ -983,32 +983,96 @@
 rties;%0A%09%7D%0A%09%0A
+%09/**%0A%09 * Set the ref value%0A%09 * %0A%09 * @param ref%0A%09 * @return%0A%09 */%0A
 %09public 
 void setRef(
@@ -1055,28 +1055,30 @@
  */%0A%09public 
-void
+Source
  setRef(Stri
@@ -1102,27 +1102,69 @@
 ref = ref;%0A%09
-%7D%0A%09
+%09return this;%0A%09%7D%0A%09%0A%09/**%0A%09 * %0A%09 * @return%0A%09 */
 %0A%09public Str
@@ -1198,32 +1198,102 @@
 s.ref;%0A%09%7D%0A%09%0A
+%09/**%0A%09 * Set the type of the source.%0A%09 * @param type%0A%09 * @return%0A%09 */%0A
 %09public 
 void setType
@@ -1276,28 +1276,30 @@
  */%0A%09public 
-void
+Source
  setType(Str
@@ -1327,27 +1327,69 @@
 pe = type;%0A%09
-%7D%0A%09
+%09return this;%0A%09%7D%0A%09%0A%09/**%0A%09 * %0A%09 * @return%0A%09 */
 %0A%09public Str
@@ -1425,32 +1425,75 @@
 .type;%0A%09%7D%0A%09%0A
+%09/**%0A%09 * %0A%09 * @param name%0A%09 * @return%0A%09 */%0A
 %09public 
 void setName
@@ -1476,28 +1476,30 @@
  */%0A%09public 
-void
+Source
  setName(Str
@@ -1527,27 +1527,69 @@
 me = name;%0A%09
-%7D%0A%09
+%09return this;%0A%09%7D%0A%09%0A%09/**%0A%09 * %0A%09 * @return%0A%09 */
 %0A%09public Str
@@ -1700,24 +1700,73 @@
 s;%0A%09%7D%0A%09%0A
+%09/**%0A%09 * %0A%09 * @param properties%0A%09 * @return%0A%09 */%0A
 %09public 
 void set
@@ -1757,20 +1757,22 @@
 %09public 
-void
+Source
  setProp
@@ -1839,24 +1839,39 @@
 properties;%0A
+%09%09return this;%0A
 %09%7D%0A%09%0A%09public
@@ -2106,118 +2106,6 @@
 %0A%09%7D%0A
-%0A%0A%09/**%0A%09 * @param args%0A%09 */%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%0A%09%7D%0A%0A
 %7D%0A

Clean up ; add member function comments ; Make usable in a builder pattern