package de.hft.stuttgart.citygml.green.osm.jaxb;

import java.util.ArrayList;
import java.util.List;

import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElements;
import jakarta.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "osm")
public class OSM {

	@XmlAttribute
	private String version;

	@XmlAttribute
	private String generator;

	@XmlElement
	private String note;

	@XmlElement
	private Meta meta;

	@XmlElement
	private Bounds bounds;

	@XmlElements(value = { @XmlElement(name = "node", type = OsmNode.class) })
	private List<OsmNode> nodes;

	@XmlElements(value = { @XmlElement(name = "way", type = OsmWay.class) })
	private List<OsmWay> ways;

	@XmlElements(value = { @XmlElement(name = "relation", type = OsmRelation.class) })
	private List<OsmRelation> relations;

	public List<OsmRelation> getRelations() {
		if (relations == null) {
			relations = new ArrayList<>();
		}
		return relations;
	}

	public List<OsmWay> getWays() {
		if (ways == null) {
			ways = new ArrayList<>();
		}
		return ways;
	}

	public List<OsmNode> getNodes() {
		if (nodes == null) {
			nodes = new ArrayList<>();
		}
		return nodes;
	}

	public Bounds getBounds() {
		return bounds;
	}

	public String getVersion() {
		return version;
	}

	public String getGenerator() {
		return generator;
	}

	public String getNote() {
		return note;
	}

	public Meta getMeta() {
		return meta;
	}

}
