public class ObjectIdElement extends AbstractElement
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME
The BSON type for a Object Id.
|
static ElementType |
TYPE
The BSON type for a Object Id.
|
ELEMENT_TYPE
Constructor and Description |
---|
ObjectIdElement(String name,
ObjectId id)
Constructs a new
ObjectIdElement . |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Accepts the visitor and calls the
Visitor.visitObjectId(java.lang.String, com.allanbank.mongodb.bson.element.ObjectId) method. |
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.
|
ObjectId |
getId()
Returns the id value.
|
ElementType |
getType()
Returns the type for the BSON type.
|
int |
hashCode()
Computes a reasonable hash code.
|
ObjectIdElement |
withName(String name)
Creates a new element with the same type and value as this element but
with the specified name.
|
public static final String DEFAULT_NAME
public static final ElementType TYPE
public ObjectIdElement(String name, ObjectId id)
ObjectIdElement
.name
- The name for the BSON Object Id.id
- The object id.IllegalArgumentException
- If the name
or id
is null
.public void accept(Visitor visitor)
Visitor.visitObjectId(java.lang.String, com.allanbank.mongodb.bson.element.ObjectId)
method.visitor
- The visitor for the element.Element.accept(Visitor)
public boolean equals(Object object)
equals
in class AbstractElement
object
- The object to compare to.Object.equals(java.lang.Object)
public ObjectId getId()
public ElementType getType()
public int hashCode()
hashCode
in class AbstractElement
public ObjectIdElement withName(String name)
Returns a new ObjectIdElement
.
name
- The new name for the element.Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.