// 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;
/**
 *      Copyright (C) 2010 Lowereast Software
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.lowereast.guiceymongo.data.generator;




public class PrimitivePropertyGenerator extends PropertyGenerator<PrimitiveType, PrimitiveProperty> {
	public PrimitivePropertyGenerator(TypeRegistry typeRegistry) {
		super(PrimitiveType.class, typeRegistry);
	}
	
	@Override
	public void createEquals(Appendable builder, PrimitiveProperty property, int indentCount) throws IOException {
// 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;

/**
 *      Copyright (C) 2010 Lowereast Software
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.lowereast.guiceymongo.data.generator;




public class PrimitivePropertyGenerator extends PropertyGenerator<PrimitiveType, PrimitiveProperty> {
	public PrimitivePropertyGenerator(TypeRegistry typeRegistry) {
		super(PrimitiveType.class, typeRegistry);
	}
	
	@Override
	public void createEquals(Appendable builder, PrimitiveProperty property, int indentCount) throws IOException {
		Type type = property.getType();