// Path: src/main/java/com/lowereast/guiceymongo/data/generator/property/PrimitiveProperty.java
// public class PrimitiveProperty extends Property<PrimitiveType> {
// 	public PrimitiveProperty(UserDataType enclosingType, String name, PrimitiveType type, String comment, boolean useCamelCaseKeys) {
// 		super(enclosingType, name, type, comment, useCamelCaseKeys);
// 	}
// 	
// 	@Override
// 	public String getKeyValue() {
// 		if (super.hasOption("identity")) {
// 			Option option = super.getOption("identity");
// 			if (option.getParameters().isEmpty())
// 				return "_id";
// 			String value = null;
// 			for (Map.Entry<String, Object> e : option.getParameters().entrySet()) {
// 				if ("value".equals(e.getKey()))
// 					value = e.getValue().toString();
// 			}
// 			if (value == null)
// 				throw new RuntimeException("Problems with the identity option... Can only be [identity] or [identity('key')] or [identity(value='key')]");
// 			return value;
// 		}
// 		return super.getKeyValue();
// 	}
// 	
// 	public String getPrimitiveType() {
// 		return super.getType().getJavaType();
// 	}
// 	
// 	public String getPrimitiveBoxedType() {
// 		return super.getType().getJavaBoxedType();
// 	}
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/generator/type/PrimitiveType.java
// public class PrimitiveType extends Type {
// 	private final String _javaBoxedType;
// 
// 	public PrimitiveType(String guiceyType, String javaType, String javaBoxedType) {
// 		super(guiceyType, javaType);
// 		_javaBoxedType = javaBoxedType;
// 	}
// 	
// 	public String getJavaBoxedType() {
// 		return _javaBoxedType;
// 	}
// 	
// 	public static PrimitiveType DoubleType = new PrimitiveType("double", "double", "Double");
// 	public static PrimitiveType FloatType = new PrimitiveType("float", "float", "Float");
// 	public static PrimitiveType Int32Type = new PrimitiveType("int32", "int", "Integer");
// 	public static PrimitiveType Int64Type = new PrimitiveType("int64", "long", "Long");
// 	public static PrimitiveType BoolType = new PrimitiveType("bool", "boolean", "Boolean");
// 	public static PrimitiveType StringType = new PrimitiveType("string", "String", "String");
// //	public static PrimitiveType BytesType = new PrimitiveType("bytes", "", ""); // byte[]??
// 	public static PrimitiveType DateType = new PrimitiveType("date", "java.util.Date", "java.util.Date");
// 	
// 	public static PrimitiveType ObjectIdType = new PrimitiveType("object_id", "org.bson.types.ObjectId", "org.bson.types.ObjectId");
// 	public static PrimitiveType DBObjectType = new PrimitiveType("db_object", "com.mongodb.DBObject", "com.mongodb.DBObject");
// 	public static PrimitiveType DBTimestampType = new PrimitiveType("db_timestamp", "org.bson.types.BSONTimestamp", "org.bson.types.BSONTimestamp");
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/generator/type/Type.java
// public class Type {
// 	protected String _guiceyType;
// 	protected String _javaType;
// 
// 	protected Type(String guiceyType) {
// 		_guiceyType = guiceyType;
// 	}
// 
// 	protected Type(String guiceyType, String javaType) {
// 		_guiceyType = guiceyType;
// 		_javaType = javaType;
// 	}
// 	
// 	public String getGuiceyType() {
// 		return _guiceyType;
// 	}
// 	
// 	public String getJavaType() {
// 		return _javaType;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return _javaType;
// 	}
// }


import java.io.IOException;
import org.antlr.stringtemplate.StringTemplate;
import com.lowereast.guiceymongo.data.generator.property.PrimitiveProperty;
import com.lowereast.guiceymongo.data.generator.type.PrimitiveType;
import com.lowereast.guiceymongo.data.generator.type.Type;
				" * $p.comment$\n" +
				" */\n" +
				"public Builder set$p.camelCaseName$($p.primitiveType$ value) {\n" +
					"$p.memberVariableName$ = value;\n" +
					"return this;\n" +
				"}\n" +
				// clear
				"/**\n" +
				" * $p.comment$\n" +
				" */\n" +
				"public Builder clear$p.camelCaseName$() {\n" +
					"$p.memberVariableName$ = null;\n" +
					"return this;\n" +
				"}\n"
		);
		template.setAttribute("p", property);
		builder.append(template.toString());
	}

	@Override
	public void createBuilderNewBuilder(Appendable builder, PrimitiveProperty property, int indentCount) throws IOException {
		StringTemplate template = new StringTemplate(
				"if (value.has$p.camelCaseName$())\n" +
					"builder.set$p.camelCaseName$(value.get$p.camelCaseName$());\n"
		);
		template.setAttribute("p", property);
		builder.append(template.toString());
	}
	
	@Override
// Path: src/main/java/com/lowereast/guiceymongo/data/generator/property/PrimitiveProperty.java
// public class PrimitiveProperty extends Property<PrimitiveType> {
// 	public PrimitiveProperty(UserDataType enclosingType, String name, PrimitiveType type, String comment, boolean useCamelCaseKeys) {
// 		super(enclosingType, name, type, comment, useCamelCaseKeys);
// 	}
// 	
// 	@Override
// 	public String getKeyValue() {
// 		if (super.hasOption("identity")) {
// 			Option option = super.getOption("identity");
// 			if (option.getParameters().isEmpty())
// 				return "_id";
// 			String value = null;
// 			for (Map.Entry<String, Object> e : option.getParameters().entrySet()) {
// 				if ("value".equals(e.getKey()))
// 					value = e.getValue().toString();
// 			}
// 			if (value == null)
// 				throw new RuntimeException("Problems with the identity option... Can only be [identity] or [identity('key')] or [identity(value='key')]");
// 			return value;
// 		}
// 		return super.getKeyValue();
// 	}
// 	
// 	public String getPrimitiveType() {
// 		return super.getType().getJavaType();
// 	}
// 	
// 	public String getPrimitiveBoxedType() {
// 		return super.getType().getJavaBoxedType();
// 	}
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/generator/type/PrimitiveType.java
// public class PrimitiveType extends Type {
// 	private final String _javaBoxedType;
// 
// 	public PrimitiveType(String guiceyType, String javaType, String javaBoxedType) {
// 		super(guiceyType, javaType);
// 		_javaBoxedType = javaBoxedType;
// 	}
// 	
// 	public String getJavaBoxedType() {
// 		return _javaBoxedType;
// 	}
// 	
// 	public static PrimitiveType DoubleType = new PrimitiveType("double", "double", "Double");
// 	public static PrimitiveType FloatType = new PrimitiveType("float", "float", "Float");
// 	public static PrimitiveType Int32Type = new PrimitiveType("int32", "int", "Integer");
// 	public static PrimitiveType Int64Type = new PrimitiveType("int64", "long", "Long");
// 	public static PrimitiveType BoolType = new PrimitiveType("bool", "boolean", "Boolean");
// 	public static PrimitiveType StringType = new PrimitiveType("string", "String", "String");
// //	public static PrimitiveType BytesType = new PrimitiveType("bytes", "", ""); // byte[]??
// 	public static PrimitiveType DateType = new PrimitiveType("date", "java.util.Date", "java.util.Date");
// 	
// 	public static PrimitiveType ObjectIdType = new PrimitiveType("object_id", "org.bson.types.ObjectId", "org.bson.types.ObjectId");
// 	public static PrimitiveType DBObjectType = new PrimitiveType("db_object", "com.mongodb.DBObject", "com.mongodb.DBObject");
// 	public static PrimitiveType DBTimestampType = new PrimitiveType("db_timestamp", "org.bson.types.BSONTimestamp", "org.bson.types.BSONTimestamp");
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/generator/type/Type.java
// public class Type {
// 	protected String _guiceyType;
// 	protected String _javaType;
// 
// 	protected Type(String guiceyType) {
// 		_guiceyType = guiceyType;
// 	}
// 
// 	protected Type(String guiceyType, String javaType) {
// 		_guiceyType = guiceyType;
// 		_javaType = javaType;
// 	}
// 	
// 	public String getGuiceyType() {
// 		return _guiceyType;
// 	}
// 	
// 	public String getJavaType() {
// 		return _javaType;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return _javaType;
// 	}
// }


// Path: src/main/java/com/lowereast/guiceymongo/data/generator/PrimitivePropertyGenerator.java
import java.io.IOException;
import org.antlr.stringtemplate.StringTemplate;
import com.lowereast.guiceymongo.data.generator.property.PrimitiveProperty;
import com.lowereast.guiceymongo.data.generator.type.PrimitiveType;
import com.lowereast.guiceymongo.data.generator.type.Type;

				" * $p.comment$\n" +
				" */\n" +
				"public Builder set$p.camelCaseName$($p.primitiveType$ value) {\n" +
					"$p.memberVariableName$ = value;\n" +
					"return this;\n" +
				"}\n" +
				// clear
				"/**\n" +
				" * $p.comment$\n" +
				" */\n" +
				"public Builder clear$p.camelCaseName$() {\n" +
					"$p.memberVariableName$ = null;\n" +
					"return this;\n" +
				"}\n"
		);
		template.setAttribute("p", property);
		builder.append(template.toString());
	}

	@Override
	public void createBuilderNewBuilder(Appendable builder, PrimitiveProperty property, int indentCount) throws IOException {
		StringTemplate template = new StringTemplate(
				"if (value.has$p.camelCaseName$())\n" +
					"builder.set$p.camelCaseName$(value.get$p.camelCaseName$());\n"
		);
		template.setAttribute("p", property);
		builder.append(template.toString());
	}
	
	@Override
	public void createBuilderBuild(Appendable builder, PrimitiveProperty property, int indentCount) throws IOException {