diff --git a/src/org/apollo/util/xml/XmlNode.java b/src/org/apollo/util/xml/XmlNode.java index 92f6effb..533892ab 100644 --- a/src/org/apollo/util/xml/XmlNode.java +++ b/src/org/apollo/util/xml/XmlNode.java @@ -1,13 +1,6 @@ package org.apollo.util.xml; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * A class which represents a single node in the DOM tree, maintaining information about its children, attributes, value @@ -153,6 +146,15 @@ public final class XmlNode implements Iterable { return value; } + /** + * Gets the value of this node, wrapped in an {@link Optional} + * + * @return The value of this node if it exists otherwise {@link Optional#empty()} is returned + */ + public Optional getOptionalValue() { + return Optional.ofNullable(value); + } + /** * Checks if this node has a value. *