com.evernote.edam.type
Class Data

java.lang.Object
  extended by com.evernote.edam.type.Data
All Implemented Interfaces:
com.evernote.thrift.TBase<Data>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Data>

public class Data
extends java.lang.Object
implements com.evernote.thrift.TBase<Data>, 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

Constructor Summary
Data()
           
Data(Data other)
          Performs a deep copy on other.
 
Method Summary
 void clear()
          Return to the state of having just been initialized, as though you had just called the default constructor.
 int compareTo(Data other)
           
 Data deepCopy()
          Creates a deep copy of the object.
 boolean equals(Data that)
           
 boolean equals(java.lang.Object that)
           
 byte[] getBody()
           
 byte[] getBodyHash()
           
 int getSize()
           
 int hashCode()
           
 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(com.evernote.thrift.protocol.TProtocol iprot)
          Reads an instance of the object from the given protocol.
 void setBody(byte[] body)
           
 void setBodyHash(byte[] bodyHash)
           
 void setBodyHashIsSet(boolean value)
           
 void setBodyIsSet(boolean value)
           
 void setSize(int size)
           
 void setSizeIsSet(boolean value)
           
 java.lang.String toString()
           
 void unsetBody()
           
 void unsetBodyHash()
           
 void unsetSize()
           
 void validate()
           
 void write(com.evernote.thrift.protocol.TProtocol oprot)
          Writes the object to the given protocol.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Data

public Data()

Data

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

Method Detail

deepCopy

public Data deepCopy()
Description copied from interface: com.evernote.thrift.TBase
Creates a deep copy of the object.

Specified by:
deepCopy in interface com.evernote.thrift.TBase<Data>

clear

public void clear()
Description copied from interface: com.evernote.thrift.TBase
Return to the state of having just been initialized, as though you had just called the default constructor.

Specified by:
clear in interface com.evernote.thrift.TBase<Data>

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)

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(com.evernote.thrift.protocol.TProtocol iprot)
          throws com.evernote.thrift.TException
Description copied from interface: com.evernote.thrift.TBase
Reads an instance of the object from the given protocol.

Specified by:
read in interface com.evernote.thrift.TBase<Data>
Parameters:
iprot - Input protocol
Throws:
com.evernote.thrift.TException

write

public void write(com.evernote.thrift.protocol.TProtocol oprot)
           throws com.evernote.thrift.TException
Description copied from interface: com.evernote.thrift.TBase
Writes the object to the given protocol.

Specified by:
write in interface com.evernote.thrift.TBase<Data>
Parameters:
oprot - Output protocol
Throws:
com.evernote.thrift.TException

toString

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

validate

public void validate()
              throws com.evernote.thrift.TException
Throws:
com.evernote.thrift.TException