com.evernote.edam.type
Class Resource

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

public class Resource
extends java.lang.Object
implements com.evernote.thrift.TBase<Resource>, java.io.Serializable, java.lang.Cloneable

Every media file that is embedded or attached to a note is represented through a Resource entry.

guid
The unique identifier of this resource. Will be set whenever a resource is retrieved from the service, but may be null when a client is creating a resource.
Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX
Regex: EDAM_GUID_REGEX
noteGuid
The unique identifier of the Note that holds this Resource. Will be set whenever the resource is retrieved from the service, but may be null when a client is creating a resource.
Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX
Regex: EDAM_GUID_REGEX
data
The contents of the resource. Maximum length: The data.body is limited to EDAM_RESOURCE_SIZE_MAX_FREE for free accounts and EDAM_RESOURCE_SIZE_MAX_PREMIUM for premium accounts.
mime
The MIME type for the embedded resource. E.g. "image/gif"
Length: EDAM_MIME_LEN_MIN - EDAM_MIME_LEN_MAX
Regex: EDAM_MIME_REGEX
width
If set, this contains the display width of this resource, in pixels.
height
If set, this contains the display height of this resource, in pixels.
duration
DEPRECATED: ignored.
active
DEPRECATED: ignored.
recognition
If set, this will hold the encoded data that provides information on search and recognition within this resource.
attributes
A list of the attributes for this resource.
updateSequenceNum
A number identifying the last transaction to modify the state of this object. The USN values are sequential within an account, and can be used to compare the order of modifications within the service.
alternateData
Some Resources may be assigned an alternate data format by the service which may be more appropriate for indexing or rendering than the original data provided by the user. In these cases, the alternate data form will be available via this Data element. If a Resource has no alternate form, this field will be unset.

See Also:
Serialized Form

Constructor Summary
Resource()
           
Resource(Resource 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(Resource other)
           
 Resource deepCopy()
          Creates a deep copy of the object.
 boolean equals(java.lang.Object that)
           
 boolean equals(Resource that)
           
 Data getAlternateData()
           
 ResourceAttributes getAttributes()
           
 Data getData()
           
 short getDuration()
           
 java.lang.String getGuid()
           
 short getHeight()
           
 java.lang.String getMime()
           
 java.lang.String getNoteGuid()
           
 Data getRecognition()
           
 int getUpdateSequenceNum()
           
 short getWidth()
           
 int hashCode()
           
 boolean isActive()
           
 boolean isSetActive()
          Returns true if field active is set (has been asigned a value) and false otherwise
 boolean isSetAlternateData()
          Returns true if field alternateData is set (has been asigned a value) and false otherwise
 boolean isSetAttributes()
          Returns true if field attributes is set (has been asigned a value) and false otherwise
 boolean isSetData()
          Returns true if field data is set (has been asigned a value) and false otherwise
 boolean isSetDuration()
          Returns true if field duration is set (has been asigned a value) and false otherwise
 boolean isSetGuid()
          Returns true if field guid is set (has been asigned a value) and false otherwise
 boolean isSetHeight()
          Returns true if field height is set (has been asigned a value) and false otherwise
 boolean isSetMime()
          Returns true if field mime is set (has been asigned a value) and false otherwise
 boolean isSetNoteGuid()
          Returns true if field noteGuid is set (has been asigned a value) and false otherwise
 boolean isSetRecognition()
          Returns true if field recognition is set (has been asigned a value) and false otherwise
 boolean isSetUpdateSequenceNum()
          Returns true if field updateSequenceNum is set (has been asigned a value) and false otherwise
 boolean isSetWidth()
          Returns true if field width 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 setActive(boolean active)
           
 void setActiveIsSet(boolean value)
           
 void setAlternateData(Data alternateData)
           
 void setAlternateDataIsSet(boolean value)
           
 void setAttributes(ResourceAttributes attributes)
           
 void setAttributesIsSet(boolean value)
           
 void setData(Data data)
           
 void setDataIsSet(boolean value)
           
 void setDuration(short duration)
           
 void setDurationIsSet(boolean value)
           
 void setGuid(java.lang.String guid)
           
 void setGuidIsSet(boolean value)
           
 void setHeight(short height)
           
 void setHeightIsSet(boolean value)
           
 void setMime(java.lang.String mime)
           
 void setMimeIsSet(boolean value)
           
 void setNoteGuid(java.lang.String noteGuid)
           
 void setNoteGuidIsSet(boolean value)
           
 void setRecognition(Data recognition)
           
 void setRecognitionIsSet(boolean value)
           
 void setUpdateSequenceNum(int updateSequenceNum)
           
 void setUpdateSequenceNumIsSet(boolean value)
           
 void setWidth(short width)
           
 void setWidthIsSet(boolean value)
           
 java.lang.String toString()
           
 void unsetActive()
           
 void unsetAlternateData()
           
 void unsetAttributes()
           
 void unsetData()
           
 void unsetDuration()
           
 void unsetGuid()
           
 void unsetHeight()
           
 void unsetMime()
           
 void unsetNoteGuid()
           
 void unsetRecognition()
           
 void unsetUpdateSequenceNum()
           
 void unsetWidth()
           
 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

Resource

public Resource()

Resource

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

Method Detail

deepCopy

public Resource 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<Resource>

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<Resource>

getGuid

public java.lang.String getGuid()

setGuid

public void setGuid(java.lang.String guid)

unsetGuid

public void unsetGuid()

isSetGuid

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


setGuidIsSet

public void setGuidIsSet(boolean value)

getNoteGuid

public java.lang.String getNoteGuid()

setNoteGuid

public void setNoteGuid(java.lang.String noteGuid)

unsetNoteGuid

public void unsetNoteGuid()

isSetNoteGuid

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


setNoteGuidIsSet

public void setNoteGuidIsSet(boolean value)

getData

public Data getData()

setData

public void setData(Data data)

unsetData

public void unsetData()

isSetData

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


setDataIsSet

public void setDataIsSet(boolean value)

getMime

public java.lang.String getMime()

setMime

public void setMime(java.lang.String mime)

unsetMime

public void unsetMime()

isSetMime

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


setMimeIsSet

public void setMimeIsSet(boolean value)

getWidth

public short getWidth()

setWidth

public void setWidth(short width)

unsetWidth

public void unsetWidth()

isSetWidth

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


setWidthIsSet

public void setWidthIsSet(boolean value)

getHeight

public short getHeight()

setHeight

public void setHeight(short height)

unsetHeight

public void unsetHeight()

isSetHeight

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


setHeightIsSet

public void setHeightIsSet(boolean value)

getDuration

public short getDuration()

setDuration

public void setDuration(short duration)

unsetDuration

public void unsetDuration()

isSetDuration

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


setDurationIsSet

public void setDurationIsSet(boolean value)

isActive

public boolean isActive()

setActive

public void setActive(boolean active)

unsetActive

public void unsetActive()

isSetActive

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


setActiveIsSet

public void setActiveIsSet(boolean value)

getRecognition

public Data getRecognition()

setRecognition

public void setRecognition(Data recognition)

unsetRecognition

public void unsetRecognition()

isSetRecognition

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


setRecognitionIsSet

public void setRecognitionIsSet(boolean value)

getAttributes

public ResourceAttributes getAttributes()

setAttributes

public void setAttributes(ResourceAttributes attributes)

unsetAttributes

public void unsetAttributes()

isSetAttributes

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


setAttributesIsSet

public void setAttributesIsSet(boolean value)

getUpdateSequenceNum

public int getUpdateSequenceNum()

setUpdateSequenceNum

public void setUpdateSequenceNum(int updateSequenceNum)

unsetUpdateSequenceNum

public void unsetUpdateSequenceNum()

isSetUpdateSequenceNum

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


setUpdateSequenceNumIsSet

public void setUpdateSequenceNumIsSet(boolean value)

getAlternateData

public Data getAlternateData()

setAlternateData

public void setAlternateData(Data alternateData)

unsetAlternateData

public void unsetAlternateData()

isSetAlternateData

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


setAlternateDataIsSet

public void setAlternateDataIsSet(boolean value)

equals

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

equals

public boolean equals(Resource that)

hashCode

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

compareTo

public int compareTo(Resource other)
Specified by:
compareTo in interface java.lang.Comparable<Resource>

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<Resource>
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<Resource>
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