com.todoroo.astrid.api
Class SyncAction

java.lang.Object
  extended by com.todoroo.astrid.api.SyncAction
All Implemented Interfaces:
android.os.Parcelable

public class SyncAction
extends java.lang.Object
implements android.os.Parcelable

Represents an intent that can be called to perform synchronization

Author:
Tim Su

Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
android.os.Parcelable.Creator<T>
 
Field Summary
static android.os.Parcelable.Creator<SyncAction> CREATOR
          Parcelable creator
 android.app.PendingIntent intent
          Intent to call when invoking this operation
 java.lang.String label
          Label
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
SyncAction(java.lang.String label, android.app.PendingIntent intent)
          Create an EditOperation object
 
Method Summary
 int describeContents()
          
 boolean equals(java.lang.Object o)
          We consider two sync actions equal if target package is identical and the labels are the same.
 int hashCode()
           
 java.lang.String toString()
          Returns the label of this action
 void writeToParcel(android.os.Parcel dest, int flags)
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

label

public java.lang.String label
Label


intent

public android.app.PendingIntent intent
Intent to call when invoking this operation


CREATOR

public static final android.os.Parcelable.Creator<SyncAction> CREATOR
Parcelable creator

Constructor Detail

SyncAction

public SyncAction(java.lang.String label,
                  android.app.PendingIntent intent)
Create an EditOperation object

Parameters:
label - label to display
intent - intent to invoke
Method Detail

toString

public java.lang.String toString()
Returns the label of this action

Overrides:
toString in class java.lang.Object

hashCode

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

equals

public boolean equals(java.lang.Object o)
We consider two sync actions equal if target package is identical and the labels are the same. This prevents duplicate pendingIntents from creating multiple SyncAction objects.

Overrides:
equals in class java.lang.Object

describeContents

public int describeContents()

Specified by:
describeContents in interface android.os.Parcelable

writeToParcel

public void writeToParcel(android.os.Parcel dest,
                          int flags)

Specified by:
writeToParcel in interface android.os.Parcelable