com.evernote.edam.type
Class Data

java.lang.Object
  extended by com.evernote.edam.type.Data
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Data
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

In several places, EDAM exchanges blocks of bytes of data for a component which may be relatively large. For example: the contents of a clipped HTML note, the bytes of an embedded image, or the recognition XML for a large image. This structure is used in the protocol to represent any of those large blocks of data when they are transmitted or when they are only referenced their metadata.

bodyHash
This field carries a one-way hash of the contents of the data body, in binary form. The hash function is MD5
Length: EDAM_HASH_LEN (exactly)
size
The length, in bytes, of the data body.
body
This field is set to contain the binary contents of the data whenever the resource is being transferred. If only metadata is being exchanged, this field will be empty. For example, a client could notify the service about the change to an attribute for a resource without transmitting the binary resource contents.

See Also:
Serialized Form

Nested Class Summary
static class Data._Fields
          The set of fields this struct contains, along with convenience methods for finding and manipulating them.
 
Field Summary
static java.util.Map<Data._Fields,FieldMetaData> metaDataMap
           
 
Constructor Summary
Data()
           
Data(Data other)
          Performs a deep copy on other.
 
Method Summary
 void clear()
           
 int compareTo(Data other)
           
 Data deepCopy()
           
 boolean equals(Data that)
           
 boolean equals(java.lang.Object that)
           
 Data._Fields fieldForId(int fieldId)
           
 byte[] getBody()
           
 byte[] getBodyHash()
           
 java.lang.Object getFieldValue(Data._Fields field)
           
 int getSize()
           
 int hashCode()
           
 boolean isSet(Data._Fields field)
          Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
 boolean isSetBody()
          Returns true if field body is set (has been asigned a value) and false otherwise
 boolean isSetBodyHash()
          Returns true if field bodyHash is set (has been asigned a value) and false otherwise
 boolean isSetSize()
          Returns true if field size is set (has been asigned a value) and false otherwise
 void read(TProtocol iprot)
           
 void setBody(byte[] body)
           
 void setBodyHash(byte[] bodyHash)
           
 void setBodyHashIsSet(boolean value)
           
 void setBodyIsSet(boolean value)
           
 void setFieldValue(Data._Fields field, java.lang.Object value)
           
 void setSize(int size)
           
 void setSizeIsSet(boolean value)
           
 java.lang.String toString()
           
 void unsetBody()
           
 void unsetBodyHash()
           
 void unsetSize()
           
 void validate()
           
 void write(TProtocol oprot)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

metaDataMap

public static final java.util.Map<Data._Fields,FieldMetaData> metaDataMap
Constructor Detail

Data

public Data()

Data

public Data(Data other)
Performs a deep copy on other.

Method Detail

deepCopy

public Data deepCopy()

clear

public void clear()

getBodyHash

public byte[] getBodyHash()

setBodyHash

public void setBodyHash(byte[] bodyHash)

unsetBodyHash

public void unsetBodyHash()

isSetBodyHash

public boolean isSetBodyHash()
Returns true if field bodyHash is set (has been asigned a value) and false otherwise


setBodyHashIsSet

public void setBodyHashIsSet(boolean value)

getSize

public int getSize()

setSize

public void setSize(int size)

unsetSize

public void unsetSize()

isSetSize

public boolean isSetSize()
Returns true if field size is set (has been asigned a value) and false otherwise


setSizeIsSet

public void setSizeIsSet(boolean value)

getBody

public byte[] getBody()

setBody

public void setBody(byte[] body)

unsetBody

public void unsetBody()

isSetBody

public boolean isSetBody()
Returns true if field body is set (has been asigned a value) and false otherwise


setBodyIsSet

public void setBodyIsSet(boolean value)

setFieldValue

public void setFieldValue(Data._Fields field,
                          java.lang.Object value)

getFieldValue

public java.lang.Object getFieldValue(Data._Fields field)

isSet

public boolean isSet(Data._Fields field)
Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise


equals

public boolean equals(java.lang.Object that)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(Data that)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(Data other)

fieldForId

public Data._Fields fieldForId(int fieldId)

read

public void read(TProtocol iprot)
          throws TException
Throws:
TException

write

public void write(TProtocol oprot)
           throws TException
Throws:
TException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

validate

public void validate()
              throws TException
Throws:
TException