public abstract class AbstractElement extends Object implements Element
Constructor and Description |
---|
AbstractElement(String name)
Constructs a new
AbstractElement . |
Modifier and Type | Method and Description |
---|---|
Element |
asElement()
Converts the object into an
Element . |
boolean |
equals(Object object)
Determines if the passed object is of this same type as this object and
if so that its fields are equal.
|
String |
getName()
Returns the name for the BSON type.
|
int |
hashCode()
Computes a reasonable hash code.
|
protected boolean |
nullSafeEquals(Object rhs,
Object lhs)
Does a null safe equals comparison.
|
<E extends Element> |
queryPath(Class<E> clazz,
String... nameRegexs)
Returns the elements matching the path of regular expressions.
|
List<Element> |
queryPath(String... nameRegexs)
Returns the elements matching the path of regular expressions.
|
String |
toString()
String form of the object.
|
public AbstractElement(String name)
AbstractElement
.name
- The name for the BSON type.public Element asElement()
Element
.
Returns this element.
asElement
in interface ElementAssignable
Element
.public boolean equals(Object object)
equals
in class Object
object
- The object to compare to.Object.equals(java.lang.Object)
public String getName()
public int hashCode()
public <E extends Element> List<E> queryPath(Class<E> clazz, String... nameRegexs)
Returns a singleton list if the nameRegexs is empty and this element's type is assignable to E. An empty list otherwise.
queryPath
in interface Element
E
- The type of element to match.clazz
- The class of elements to match.nameRegexs
- The path of regular expressions.Element.queryPath(java.lang.Class<E>, java.lang.String...)
public List<Element> queryPath(String... nameRegexs)
Returns a singleton list if the nameRegexs is empty. An empty list otherwise.
queryPath
in interface Element
nameRegexs
- The path of regular expressions.Element.queryPath(java.lang.Class<E>, java.lang.String...)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.