// 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-builder/src/main/java/org/ugeojson/builder/exception/InvalidPositionDtoException.java
// public class InvalidPositionDtoException extends RuntimeException {
//  
// 	private static final long serialVersionUID = 1L;
// 
// 	public InvalidPositionDtoException(PositionDto position) {
// 		super("Invalid position dto: " + position);
// 	}
// 
// }
// 
// Path: ugeojson-model/src/main/java/org/ugeojson/model/PositionDto.java
// public class PositionDto implements Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private double[] numbers;
// 
// 	/**
// 	 * This constructor initializes numbers field to hold two double numbers. Do
// 	 * not use this constructor if you need the third elevation parameter.
// 	 */
// 	public PositionDto() {
// 		this.numbers = new double[2];
// 	}
// 
// 	/**
// 	 * Simple coordinate position constructor
// 	 * 
// 	 * @param longitude
// 	 * @param latitude
// 	 */
// 	public PositionDto(double longitude, double latitude) {
// 		this.numbers = new double[] { longitude, latitude };
// 	}
// 
// 	/**
// 	 * Use this constructor if you need elevation parameter
// 	 * 
// 	 * @param longitude
// 	 * @param latitude
// 	 * @param elevation
// 	 */
// 	public PositionDto(double longitude, double latitude, double elevation) {
// 		this.numbers = new double[] { longitude, latitude, elevation };
// 	}
// 
// 	/**
// 	 * Copy constructor
// 	 * 
// 	 * @param position
// 	 */
// 	public PositionDto(PositionDto position) {
// 		if (position != null) {
// 			double[] copyNumbers = position.getNumbers();
// 			this.numbers = new double[copyNumbers.length];
// 			for (int i = 0; i < copyNumbers.length; i++) {
// 				this.numbers[i] = copyNumbers[i];
// 			}
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		if (numbers == null) {
// 			return "null numbers[]";
// 		}
// 		StringBuilder value = new StringBuilder("[");
// 		for (int i = 0; i < numbers.length; i++) {
// 			value.append(numbers[i]);
// 			if (i < numbers.length - 1) {
// 				value.append(", ");
// 			}
// 		}
// 		value.append("]");
// 		return value.toString();
// 	}
// 
// 	public void setLongitude(double longitude) {
// 		this.numbers[0] = longitude;
// 	}
// 
// 	public double getLongitude() {
// 		return numbers[0];
// 	}
// 
// 	public void setLatitude(double latitude) {
// 		this.numbers[1] = latitude;
// 	}
// 
// 	public double getLatitude() {
// 		return numbers[1];
// 	}
// 
// 	public void setElevation(double elevation) {
// 		this.numbers[2] = elevation;
// 	}
// 
// 	public double getElevation() {
// 		return numbers[2];
// 	}
// 
// 	public double[] getNumbers() {
// 		return numbers;
// 	}
// 
// 	public void setNumbers(double[] numbers) {
// 		this.numbers = numbers;
// 	}
// }


import org.ugeojson.builder.common.BuilderConstants;
import org.ugeojson.builder.exception.InvalidPositionDtoException;
import org.ugeojson.model.PositionDto;
package org.ugeojson.builder.geometry;


/**
 * @author moksuzer
 *
 */
public class PositionBuilder {

	private static final int MINIMUM_POSITION_DIMENSION = 2;

	private static final PositionBuilder INSTANCE = new PositionBuilder();
	
	
	public static PositionBuilder getInstance(){
		return INSTANCE;
	}

	private PositionBuilder(){
	}
	
	public String position(PositionDto position) {
		if(position == null || position.getNumbers().length < MINIMUM_POSITION_DIMENSION){
// 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-builder/src/main/java/org/ugeojson/builder/exception/InvalidPositionDtoException.java
// public class InvalidPositionDtoException extends RuntimeException {
//  
// 	private static final long serialVersionUID = 1L;
// 
// 	public InvalidPositionDtoException(PositionDto position) {
// 		super("Invalid position dto: " + position);
// 	}
// 
// }
// 
// Path: ugeojson-model/src/main/java/org/ugeojson/model/PositionDto.java
// public class PositionDto implements Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private double[] numbers;
// 
// 	/**
// 	 * This constructor initializes numbers field to hold two double numbers. Do
// 	 * not use this constructor if you need the third elevation parameter.
// 	 */
// 	public PositionDto() {
// 		this.numbers = new double[2];
// 	}
// 
// 	/**
// 	 * Simple coordinate position constructor
// 	 * 
// 	 * @param longitude
// 	 * @param latitude
// 	 */
// 	public PositionDto(double longitude, double latitude) {
// 		this.numbers = new double[] { longitude, latitude };
// 	}
// 
// 	/**
// 	 * Use this constructor if you need elevation parameter
// 	 * 
// 	 * @param longitude
// 	 * @param latitude
// 	 * @param elevation
// 	 */
// 	public PositionDto(double longitude, double latitude, double elevation) {
// 		this.numbers = new double[] { longitude, latitude, elevation };
// 	}
// 
// 	/**
// 	 * Copy constructor
// 	 * 
// 	 * @param position
// 	 */
// 	public PositionDto(PositionDto position) {
// 		if (position != null) {
// 			double[] copyNumbers = position.getNumbers();
// 			this.numbers = new double[copyNumbers.length];
// 			for (int i = 0; i < copyNumbers.length; i++) {
// 				this.numbers[i] = copyNumbers[i];
// 			}
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		if (numbers == null) {
// 			return "null numbers[]";
// 		}
// 		StringBuilder value = new StringBuilder("[");
// 		for (int i = 0; i < numbers.length; i++) {
// 			value.append(numbers[i]);
// 			if (i < numbers.length - 1) {
// 				value.append(", ");
// 			}
// 		}
// 		value.append("]");
// 		return value.toString();
// 	}
// 
// 	public void setLongitude(double longitude) {
// 		this.numbers[0] = longitude;
// 	}
// 
// 	public double getLongitude() {
// 		return numbers[0];
// 	}
// 
// 	public void setLatitude(double latitude) {
// 		this.numbers[1] = latitude;
// 	}
// 
// 	public double getLatitude() {
// 		return numbers[1];
// 	}
// 
// 	public void setElevation(double elevation) {
// 		this.numbers[2] = elevation;
// 	}
// 
// 	public double getElevation() {
// 		return numbers[2];
// 	}
// 
// 	public double[] getNumbers() {
// 		return numbers;
// 	}
// 
// 	public void setNumbers(double[] numbers) {
// 		this.numbers = numbers;
// 	}
// }


// Path: ugeojson-builder/src/main/java/org/ugeojson/builder/geometry/PositionBuilder.java
import org.ugeojson.builder.common.BuilderConstants;
import org.ugeojson.builder.exception.InvalidPositionDtoException;
import org.ugeojson.model.PositionDto;

package org.ugeojson.builder.geometry;


/**
 * @author moksuzer
 *
 */
public class PositionBuilder {

	private static final int MINIMUM_POSITION_DIMENSION = 2;

	private static final PositionBuilder INSTANCE = new PositionBuilder();
	
	
	public static PositionBuilder getInstance(){
		return INSTANCE;
	}

	private PositionBuilder(){
	}
	
	public String position(PositionDto position) {
		if(position == null || position.getNumbers().length < MINIMUM_POSITION_DIMENSION){
			throw new InvalidPositionDtoException(position);