// Path: src/main/java/com/rc/gds/Key.java
// public class Key implements Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	String kind, id;
// 	Long version;
// 
// 	public Key() {
// 	}
// 	
// 	public Key(Map<String, Object> map) {
// 		id = (String) map.get("id");
// 		kind = (String) map.get("kind");
// 	}
// 	
// 	public Key(Class<?> clazz, String id) {
// 		this.id = id;
// 		kind = GDSClass.getKind(clazz);
// 	}
// 
// 	public Key(String kind, String id) {
// 		this.id = id;
// 		this.kind = kind;
// 	}
// 
// 	public Key(String kind, String id, long version) {
// 		this(kind, id);
// 		this.version = version;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		Key other = (Key) obj;
// 		if (id == null) {
// 			if (other.id != null)
// 				return false;
// 		} else if (!id.equals(other.id))
// 			return false;
// 		if (kind == null) {
// 			if (other.kind != null)
// 				return false;
// 		} else if (!kind.equals(other.kind))
// 			return false;
// 		return true;
// 	}
// 	
// 	public String getId() {
// 		return id;
// 	}
// 	
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 	
// 	public String getKind() {
// 		return kind;
// 	}
// 	
// 	public void setKind(String kind) {
// 		this.kind = kind;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + (id == null ? 0 : id.hashCode());
// 		result = prime * result + (kind == null ? 0 : kind.hashCode());
// 		return result;
// 	}
// 	
// 	public Map<String, Object> toMap() {
// 		Map<String, Object> map = new HashMap<>();
// 		map.put("id", id);
// 		map.put("kind", kind);
// 		return map;
// 	}
// 
// }


import com.rc.gds.Key;

package com.rc.gds.interfaces;


public interface GDSSaver {
	
	public abstract GDSSaver entity(Object pojo);
	
	public abstract GDSSaver withSpecialID(String specialID);
	
	/**
	 * This function will force the re-saving of any pojo that already have an ID set. Normal behaviour is for all new pojos (pojos with a
	 * blank ID) to be saved recursively, and all pojos that have an ID to be skipped as they are already saved. Not really recommended to
	 * use this function - you should rather save objects directly when you update them!
	 * 
	 * Be very careful of cyclical links in your object graph - it will cause a stack overflow exception when setting this to true.
	 * 
	 * @param recursiveUpdate
	 * @return
	 */
	public abstract GDSSaver forceRecursiveUpdate(boolean recursiveUpdate);
	

// Path: src/main/java/com/rc/gds/Key.java
// public class Key implements Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	String kind, id;
// 	Long version;
// 
// 	public Key() {
// 	}
// 	
// 	public Key(Map<String, Object> map) {
// 		id = (String) map.get("id");
// 		kind = (String) map.get("kind");
// 	}
// 	
// 	public Key(Class<?> clazz, String id) {
// 		this.id = id;
// 		kind = GDSClass.getKind(clazz);
// 	}
// 
// 	public Key(String kind, String id) {
// 		this.id = id;
// 		this.kind = kind;
// 	}
// 
// 	public Key(String kind, String id, long version) {
// 		this(kind, id);
// 		this.version = version;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		Key other = (Key) obj;
// 		if (id == null) {
// 			if (other.id != null)
// 				return false;
// 		} else if (!id.equals(other.id))
// 			return false;
// 		if (kind == null) {
// 			if (other.kind != null)
// 				return false;
// 		} else if (!kind.equals(other.kind))
// 			return false;
// 		return true;
// 	}
// 	
// 	public String getId() {
// 		return id;
// 	}
// 	
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 	
// 	public String getKind() {
// 		return kind;
// 	}
// 	
// 	public void setKind(String kind) {
// 		this.kind = kind;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + (id == null ? 0 : id.hashCode());
// 		result = prime * result + (kind == null ? 0 : kind.hashCode());
// 		return result;
// 	}
// 	
// 	public Map<String, Object> toMap() {
// 		Map<String, Object> map = new HashMap<>();
// 		map.put("id", id);
// 		map.put("kind", kind);
// 		return map;
// 	}
// 
// }


// Path: src/main/java/com/rc/gds/interfaces/GDSSaver.java
import com.rc.gds.Key;

package com.rc.gds.interfaces;


public interface GDSSaver {
	
	public abstract GDSSaver entity(Object pojo);
	
	public abstract GDSSaver withSpecialID(String specialID);
	
	/**
	 * This function will force the re-saving of any pojo that already have an ID set. Normal behaviour is for all new pojos (pojos with a
	 * blank ID) to be saved recursively, and all pojos that have an ID to be skipped as they are already saved. Not really recommended to
	 * use this function - you should rather save objects directly when you update them!
	 * 
	 * Be very careful of cyclical links in your object graph - it will cause a stack overflow exception when setting this to true.
	 * 
	 * @param recursiveUpdate
	 * @return
	 */
	public abstract GDSSaver forceRecursiveUpdate(boolean recursiveUpdate);
	

	public abstract Key now();
