// Path: ugeojson-builder/src/main/java/org/ugeojson/builder/common/BuilderConstants.java
// public interface BuilderConstants {
// 
// 	public static final String OPEN_BRACKET = "[";
// 	public static final String CLOSE_BRACKET = "]";
// 	public static final String OPEN_CURLY_BRACE = "{";
// 	public static final String CLOSE_CURLY_BRACE = "}";
// 	
// 	public static final String COMMA_SPACE = ", ";
// 	public static final String COMMA = ",";
// 	public static final String SPACE = " ";
// 	public static final String COMMA_NEWLINE = ",\n";
// 	public static final String NEWLINE = "\n";
// 	public static final String DOUBLE_QUOTE = "\"";
// 	public static final String NULL_VALUE = "null";
// 	public static final String TAB_SPACE = "	";
// 	public static final String EMPTY = "";
// 	
// 	public static final String TYPE_SPACE = "\"type\": ";
// 	public static final String COORDINATES_SPACE = "\"coordinates\": ";
// 	public static final String GEOMETRIES_SPACE = "\"geometries\": ";
// 	public static final String GEOMETRY_SPACE = "\"geometry\": ";
// 	public static final String PROPERTIES_SPACE = "\"properties\": ";
// 	public static final String ID_SPACE = "\"id\": ";
// 	public static final String FEATURES_SPACE = "\"features\": ";
// 	public static final String BBOX_SPACE = "\"bbox\": ";
// }
// 
// Path: ugeojson-model/src/main/java/org/ugeojson/model/GeoJSONObjectTypeEnum.java
// public enum GeoJSONObjectTypeEnum {
// 
// 	Point(PointDto.class), MultiPoint(MultiPointDto.class), LineString(LineStringDto.class), MultiLineString(
// 			MultiLineStringDto.class), Polygon(PolygonDto.class), MultiPolygon(
// 					MultiPolygonDto.class), GeometryCollection(GeometryCollectionDto.class), Feature(
// 							FeatureDto.class), FeatureCollection(FeatureCollectionDto.class);
// 
// 	private final Class dtoClass;
// 
// 	private GeoJSONObjectTypeEnum(Class dtoClass) {
// 		this.dtoClass = dtoClass;
// 	}
// 
// 	public Class getDtoClass() {
// 		return dtoClass;
// 	}
// }
// 
// Path: ugeojson-model/src/main/java/org/ugeojson/model/geometry/PointDto.java
// public class PointDto extends GeometryDto {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private PositionDto position;
// 
// 	/**
// 	 * Creates two-dimensional position
// 	 */
// 	public PointDto() {
// 		this.position = new PositionDto();
// 	}
// 
// 	/**
// 	 * Creates two-dimensional position with given longitude and latitude
// 	 *
// 	 * @param longitude
// 	 * @param latitude
// 	 */
// 	public PointDto(double longitude, double latitude) {
// 		this.position = new PositionDto(longitude, latitude);
// 	}
// 
// 	/**
// 	 * Creates three-dimensional position with given longitude, latitude and
// 	 * elevation
// 	 * 
// 	 * @param longitude
// 	 * @param latitude
// 	 * @param elevation
// 	 */
// 	public PointDto(double longitude, double latitude, double elevation) {
// 		this.position = new PositionDto(longitude, latitude, elevation);
// 	}
// 
// 	/**
// 	 * Creates point with position parameters of given point 
// 	 * 
// 	 * @param point
// 	 */
// 	public PointDto(PointDto point) {
// 		this.position = new PositionDto(point.getPosition());
// 	}
// 
// 	/**
// 	 * @param position
// 	 */
// 	public PointDto(PositionDto position) {
// 		 this.position = new PositionDto(position);
// 	}
// 
// 	public double getLongitude() {
// 		return this.position.getLongitude();
// 	}
// 
// 	public void setLongitude(double longitude) {
// 		this.position.setLongitude(longitude);
// 	}
// 
// 	public double getLatitude() {
// 		return this.position.getLatitude();
// 	}
// 
// 	public void setLatitude(double latitude) {
// 		this.position.setLatitude(latitude);
// 	}
// 
// 	public void setElevation(double elevation) {
// 		this.position.setElevation(elevation);
// 	}
// 
// 	public double getElevation() {
// 		return this.position.getElevation();
// 	}
// 
// 	public PositionDto getPosition() {
// 		return position;
// 	}
// 
// 	public void setPosition(PositionDto position) {
// 		this.position = position;
// 	}
// 
// 	@Override
// 	public GeoJSONObjectTypeEnum getGeoJSONObjectType() {
// 		return GeoJSONObjectTypeEnum.Point;
// 	}
// 
// }


import org.ugeojson.builder.common.BuilderConstants;
import org.ugeojson.model.GeoJSONObjectTypeEnum;
import org.ugeojson.model.geometry.PointDto;
package org.ugeojson.builder.geometry;


/**
 * @author moksuzer
 *
 */
public class PointBuilder extends GeometryBuilder<PointDto> {

	private static final PointBuilder INSTANCE = new PointBuilder();

	public static PointBuilder getInstance() {
		return INSTANCE;
	}

	private PointBuilder() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.ugeojson.builder.geometry.GeometryBuilder#toGeometryGeoJSON(com
	 * .erumi.ugeojson.model.geometry.GeometryDto)
	 */
	@Override
	public String toGeoJSON(PointDto point) {
		if (point == null || point.getPosition() == null || point.getPosition().getNumbers().length == 0) {
			return BuilderConstants.NULL_VALUE;
		}

		StringBuilder builder = initializeBuilder();
		buildTypePart(builder, GeoJSONObjectTypeEnum.Point);

// Path: ugeojson-builder/src/main/java/org/ugeojson/builder/common/BuilderConstants.java
// public interface BuilderConstants {
// 
// 	public static final String OPEN_BRACKET = "[";
// 	public static final String CLOSE_BRACKET = "]";
// 	public static final String OPEN_CURLY_BRACE = "{";
// 	public static final String CLOSE_CURLY_BRACE = "}";
// 	
// 	public static final String COMMA_SPACE = ", ";
// 	public static final String COMMA = ",";
// 	public static final String SPACE = " ";
// 	public static final String COMMA_NEWLINE = ",\n";
// 	public static final String NEWLINE = "\n";
// 	public static final String DOUBLE_QUOTE = "\"";
// 	public static final String NULL_VALUE = "null";
// 	public static final String TAB_SPACE = "	";
// 	public static final String EMPTY = "";
// 	
// 	public static final String TYPE_SPACE = "\"type\": ";
// 	public static final String COORDINATES_SPACE = "\"coordinates\": ";
// 	public static final String GEOMETRIES_SPACE = "\"geometries\": ";
// 	public static final String GEOMETRY_SPACE = "\"geometry\": ";
// 	public static final String PROPERTIES_SPACE = "\"properties\": ";
// 	public static final String ID_SPACE = "\"id\": ";
// 	public static final String FEATURES_SPACE = "\"features\": ";
// 	public static final String BBOX_SPACE = "\"bbox\": ";
// }
// 
// Path: ugeojson-model/src/main/java/org/ugeojson/model/GeoJSONObjectTypeEnum.java
// public enum GeoJSONObjectTypeEnum {
// 
// 	Point(PointDto.class), MultiPoint(MultiPointDto.class), LineString(LineStringDto.class), MultiLineString(
// 			MultiLineStringDto.class), Polygon(PolygonDto.class), MultiPolygon(
// 					MultiPolygonDto.class), GeometryCollection(GeometryCollectionDto.class), Feature(
// 							FeatureDto.class), FeatureCollection(FeatureCollectionDto.class);
// 
// 	private final Class dtoClass;
// 
// 	private GeoJSONObjectTypeEnum(Class dtoClass) {
// 		this.dtoClass = dtoClass;
// 	}
// 
// 	public Class getDtoClass() {
// 		return dtoClass;
// 	}
// }
// 
// Path: ugeojson-model/src/main/java/org/ugeojson/model/geometry/PointDto.java
// public class PointDto extends GeometryDto {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private PositionDto position;
// 
// 	/**
// 	 * Creates two-dimensional position
// 	 */
// 	public PointDto() {
// 		this.position = new PositionDto();
// 	}
// 
// 	/**
// 	 * Creates two-dimensional position with given longitude and latitude
// 	 *
// 	 * @param longitude
// 	 * @param latitude
// 	 */
// 	public PointDto(double longitude, double latitude) {
// 		this.position = new PositionDto(longitude, latitude);
// 	}
// 
// 	/**
// 	 * Creates three-dimensional position with given longitude, latitude and
// 	 * elevation
// 	 * 
// 	 * @param longitude
// 	 * @param latitude
// 	 * @param elevation
// 	 */
// 	public PointDto(double longitude, double latitude, double elevation) {
// 		this.position = new PositionDto(longitude, latitude, elevation);
// 	}
// 
// 	/**
// 	 * Creates point with position parameters of given point 
// 	 * 
// 	 * @param point
// 	 */
// 	public PointDto(PointDto point) {
// 		this.position = new PositionDto(point.getPosition());
// 	}
// 
// 	/**
// 	 * @param position
// 	 */
// 	public PointDto(PositionDto position) {
// 		 this.position = new PositionDto(position);
// 	}
// 
// 	public double getLongitude() {
// 		return this.position.getLongitude();
// 	}
// 
// 	public void setLongitude(double longitude) {
// 		this.position.setLongitude(longitude);
// 	}
// 
// 	public double getLatitude() {
// 		return this.position.getLatitude();
// 	}
// 
// 	public void setLatitude(double latitude) {
// 		this.position.setLatitude(latitude);
// 	}
// 
// 	public void setElevation(double elevation) {
// 		this.position.setElevation(elevation);
// 	}
// 
// 	public double getElevation() {
// 		return this.position.getElevation();
// 	}
// 
// 	public PositionDto getPosition() {
// 		return position;
// 	}
// 
// 	public void setPosition(PositionDto position) {
// 		this.position = position;
// 	}
// 
// 	@Override
// 	public GeoJSONObjectTypeEnum getGeoJSONObjectType() {
// 		return GeoJSONObjectTypeEnum.Point;
// 	}
// 
// }


// Path: ugeojson-builder/src/main/java/org/ugeojson/builder/geometry/PointBuilder.java
import org.ugeojson.builder.common.BuilderConstants;
import org.ugeojson.model.GeoJSONObjectTypeEnum;
import org.ugeojson.model.geometry.PointDto;

package org.ugeojson.builder.geometry;


/**
 * @author moksuzer
 *
 */
public class PointBuilder extends GeometryBuilder<PointDto> {

	private static final PointBuilder INSTANCE = new PointBuilder();

	public static PointBuilder getInstance() {
		return INSTANCE;
	}

	private PointBuilder() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.ugeojson.builder.geometry.GeometryBuilder#toGeometryGeoJSON(com
	 * .erumi.ugeojson.model.geometry.GeometryDto)
	 */
	@Override
	public String toGeoJSON(PointDto point) {
		if (point == null || point.getPosition() == null || point.getPosition().getNumbers().length == 0) {
			return BuilderConstants.NULL_VALUE;
		}

		StringBuilder builder = initializeBuilder();
		buildTypePart(builder, GeoJSONObjectTypeEnum.Point);

		builder.append(BuilderConstants.COORDINATES_SPACE);