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, java.lang.Comparable<Data>, org.apache.thrift.TBase<Data._Fields>

public class Data
extends java.lang.Object
implements org.apache.thrift.TBase<Data._Fields>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Data>

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,org.apache.thrift.meta_data.FieldMetaData> metaDataMap
           
 
Constructor Summary
Data()
           
Data(Data other)
          Performs a deep copy on other.
 
Method Summary
 Data clone()
          Deprecated. 
 int compareTo(Data other)
           
 Data deepCopy()
           
 boolean equals(Data that)
           
 boolean equals(java.lang.Object that)
           
 byte[] getBody()
           
 byte[] getBodyHash()
           
 java.lang.Object getFieldValue(Data._Fields field)
           
 java.lang.Object getFieldValue(int fieldId)
           
 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 isSet(int fieldID)
           
 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(org.apache.thrift.protocol.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 setFieldValue(int fieldID, 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(org.apache.thrift.protocol.TProtocol oprot)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

metaDataMap

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

Data

public Data()

Data

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

Method Detail

deepCopy

public Data deepCopy()
Specified by:
deepCopy in interface org.apache.thrift.TBase<Data._Fields>

clone

@Deprecated
public Data clone()
Deprecated. 

Overrides:
clone in class java.lang.Object

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)
Specified by:
setFieldValue in interface org.apache.thrift.TBase<Data._Fields>

setFieldValue

public void setFieldValue(int fieldID,
                          java.lang.Object value)
Specified by:
setFieldValue in interface org.apache.thrift.TBase<Data._Fields>

getFieldValue

public java.lang.Object getFieldValue(Data._Fields field)
Specified by:
getFieldValue in interface org.apache.thrift.TBase<Data._Fields>

getFieldValue

public java.lang.Object getFieldValue(int fieldId)
Specified by:
getFieldValue in interface org.apache.thrift.TBase<Data._Fields>

isSet

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

Specified by:
isSet in interface org.apache.thrift.TBase<Data._Fields>

isSet

public boolean isSet(int fieldID)
Specified by:
isSet in interface org.apache.thrift.TBase<Data._Fields>

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)
Specified by:
compareTo in interface java.lang.Comparable<Data>

read

public void read(org.apache.thrift.protocol.TProtocol iprot)
          throws org.apache.thrift.TException
Specified by:
read in interface org.apache.thrift.TBase<Data._Fields>
Throws:
org.apache.thrift.TException

write

public void write(org.apache.thrift.protocol.TProtocol oprot)
           throws org.apache.thrift.TException
Specified by:
write in interface org.apache.thrift.TBase<Data._Fields>
Throws:
org.apache.thrift.TException

toString

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

validate

public void validate()
              throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException