package tag;

import java.util.Optional;

public class Tag {

	private final TagName name;
	private Optional<String> additionalData = Optional.empty();

	public Tag(TagName name) {
		this.name = name;
	}

	public Tag(TagName name, Optional<String> additionalData) {
		this.name = name;
		this.additionalData = additionalData;
	}

	@Override
	public String toString() {
		return "Tag: " + name + " " + additionalData.orElse("");
	}

	public TagName getName() {
		return name;
	}

	public Optional<String> getAdditionalData() {
		return additionalData;
	}

	public Tag addAdditionalData(String additionalData) {
		this.additionalData = Optional.of(additionalData);
		return this;
	}
}
