public class MaxKeyElement extends AbstractElement
| Modifier and Type | Field and Description |
|---|---|
static ElementType |
TYPE
The BSON type for a binary.
|
ELEMENT_TYPE| Constructor and Description |
|---|
MaxKeyElement(String name)
Constructs a new
MaxKeyElement. |
MaxKeyElement(String name,
long size)
Constructs a new
MaxKeyElement. |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor visitor)
Accepts the visitor and calls the
Visitor.visitMaxKey(java.lang.String) method. |
ElementType |
getType()
Returns the type for the BSON type.
|
Double |
getValueAsObject()
Returns the value for BSON element as a Java
Object type. |
MaxKeyElement |
withName(String name)
Creates a new element with the same type and value as this element but
with the specified name.
|
asElement, compareTo, equals, find, find, findFirst, findFirst, getName, getValueAsString, hashCode, nullSafeEquals, size, toStringpublic static final ElementType TYPE
public MaxKeyElement(String name)
MaxKeyElement.name - The name for the BSON maximum key.IllegalArgumentException - If the name is null.public MaxKeyElement(String name, long size)
MaxKeyElement.name - The name for the BSON maximum key.size - The size of the element when encoded in bytes. If not known
then use the MaxKeyElement(String)
constructor instead.IllegalArgumentException - If the name is null.public void accept(Visitor visitor)
Visitor.visitMaxKey(java.lang.String) method.visitor - The visitor for the element.Element.accept(Visitor)public ElementType getType()
public Double getValueAsObject()
Object type.
Automatic conversion from the Object-ified value to an element is
provided via the DocumentBuilder.add(String, Object) method. Not
all element types will be successfully converted to the same element
duing a Element-->Object value-->Element conversion. This cases are noted
in the appropriate sub-type's JavaDoc.
Sub-types will also overload this method with the appropriate type
returned. e.g., The
StringElement.getValueAsObject()
method signature returns a String.
Returns a Double with the value Double.POSITIVE_INFINITY.
Note: This value will not be recreated is a Object-->Element
conversion. Double with the Double.POSITIVE_INFINITY value is
created instead.
Object type.public MaxKeyElement withName(String name)
Returns a new MaxKeyElement.
name - The new name for the element.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.