public class BinaryElement extends AbstractElement
| Modifier and Type | Field and Description |
|---|---|
static byte |
DEFAULT_SUB_TYPE
The sub type used when no sub type is specified.
|
static ElementType |
TYPE
The BSON type for a binary.
|
ELEMENT_TYPE| Constructor and Description |
|---|
BinaryElement(String name,
byte[] value)
Constructs a new
BinaryElement. |
BinaryElement(String name,
byte subType,
byte[] value)
Constructs a new
BinaryElement. |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor visitor)
Accepts the visitor and calls the
Visitor.visitBinary(java.lang.String, byte, byte[]) 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.
|
byte |
getSubType()
Return the binary sub-type.
|
ElementType |
getType()
Returns the type for the BSON type.
|
byte[] |
getValue()
Returns the BSON binary value.
|
int |
hashCode()
Computes a reasonable hash code.
|
BinaryElement |
withName(String name)
Creates a new element with the same type and value as this element but
with the specified name.
|
public static final byte DEFAULT_SUB_TYPE
public static final ElementType TYPE
public BinaryElement(String name, byte subType, byte[] value)
BinaryElement.name - The name for the BSON binary.subType - The sub-type of the binary data.value - The BSON binary value.IllegalArgumentException - If the name or value is null.public BinaryElement(String name, byte[] value)
BinaryElement. Uses the
DEFAULT_SUB_TYPE.name - The name for the BSON binary.value - The BSON binary value.IllegalArgumentException - If the name or value is null.public void accept(Visitor visitor)
Visitor.visitBinary(java.lang.String, byte, byte[]) method.visitor - The visitor for the element.Element.accept(Visitor)public boolean equals(Object object)
equals in class AbstractElementobject - The object to compare to.Object.equals(java.lang.Object)public byte getSubType()
public ElementType getType()
public byte[] getValue()
public int hashCode()
hashCode in class AbstractElementpublic BinaryElement withName(String name)
Returns a new BinaryElement.
name - The new name for the element.Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.