// 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/LineStringDto.java
// public class LineStringDto extends GeometryDto {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private List<PositionDto> positions;
// 
// 	public LineStringDto(){
// 	}
// 	
// 	public LineStringDto(List<PositionDto> positions){
// 		this.positions = new ArrayList<>();
// 		for (PositionDto positionDto : positions) {
// 			this.positions.add(new PositionDto(positionDto));
// 		}
// 	}
// 
// 	public List<PositionDto> getPositions() {
// 		return positions;
// 	}
// 
// 	public void setPositions(List<PositionDto> positions) {
// 		this.positions = positions;
// 	}
// 
// 	@Override
// 	public GeoJSONObjectTypeEnum getGeoJSONObjectType() {
// 		return GeoJSONObjectTypeEnum.LineString;
// 	}
// }


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


/**
 * @author moksuzer
 *
 */
public class LineStringBuilder extends GeometryBuilder<LineStringDto> {

	private static final LineStringBuilder INSTANCE = new LineStringBuilder();

	public static LineStringBuilder getInstance() {
		return INSTANCE;
	}

	private LineStringBuilder() {
	}

	@Override
	public String toGeoJSON(LineStringDto lineString) {
		if (lineString == null || lineString.getPositions() == null || lineString.getPositions().isEmpty()) {
			return BuilderConstants.NULL_VALUE;
		}

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

		builder.append(BuilderConstants.COORDINATES_SPACE);
// 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/LineStringDto.java
// public class LineStringDto extends GeometryDto {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private List<PositionDto> positions;
// 
// 	public LineStringDto(){
// 	}
// 	
// 	public LineStringDto(List<PositionDto> positions){
// 		this.positions = new ArrayList<>();
// 		for (PositionDto positionDto : positions) {
// 			this.positions.add(new PositionDto(positionDto));
// 		}
// 	}
// 
// 	public List<PositionDto> getPositions() {
// 		return positions;
// 	}
// 
// 	public void setPositions(List<PositionDto> positions) {
// 		this.positions = positions;
// 	}
// 
// 	@Override
// 	public GeoJSONObjectTypeEnum getGeoJSONObjectType() {
// 		return GeoJSONObjectTypeEnum.LineString;
// 	}
// }


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

package org.ugeojson.builder.geometry;


/**
 * @author moksuzer
 *
 */
public class LineStringBuilder extends GeometryBuilder<LineStringDto> {

	private static final LineStringBuilder INSTANCE = new LineStringBuilder();

	public static LineStringBuilder getInstance() {
		return INSTANCE;
	}

	private LineStringBuilder() {
	}

	@Override
	public String toGeoJSON(LineStringDto lineString) {
		if (lineString == null || lineString.getPositions() == null || lineString.getPositions().isEmpty()) {
			return BuilderConstants.NULL_VALUE;
		}

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

		builder.append(BuilderConstants.COORDINATES_SPACE);
		builder.append(BuilderConstants.OPEN_BRACKET);