mirror of https://github.com/ThmmyNoLife/mTHMMY
				
				
			
				 11 changed files with 79 additions and 80 deletions
			
			
		| @ -1,4 +1,4 @@ | |||
| package gr.thmmy.mthmmy.utils.parsing; | |||
| package gr.thmmy.mthmmy.utils; | |||
| 
 | |||
| import android.os.AsyncTask; | |||
| 
 | |||
| @ -0,0 +1,32 @@ | |||
| package gr.thmmy.mthmmy.utils; | |||
| 
 | |||
| public class NetworkResultCodes { | |||
|     /** | |||
|      * The request was successful | |||
|      */ | |||
|     public static final int SUCCESSFUL = 0; | |||
|     /** | |||
|      * Error 404, page was not found | |||
|      */ | |||
|     public static final int NOT_FOUND = 1; | |||
|     /** | |||
|      * User session ended while posting the reply | |||
|      */ | |||
|     public static final int SESSION_ENDED = 2; | |||
|     /** | |||
|      * Exception occured while parsing | |||
|      */ | |||
|     public static final int PARSE_ERROR = 3; | |||
|     /** | |||
|      * Other undefined of unidentified error | |||
|      */ | |||
|     public static final int OTHER_ERROR = 4; | |||
|     /** | |||
|      * Failed to connect to thmmy.gr | |||
|      */ | |||
|     public static final int NETWORK_ERROR = 5; | |||
|     /** | |||
|      * Error while excecuting NetworkTask's performTask() | |||
|      */ | |||
|     public static final int PERFORM_TASK_ERROR = 6; | |||
| } | |||
| @ -0,0 +1,20 @@ | |||
| package gr.thmmy.mthmmy.utils; | |||
| 
 | |||
| public class Parcel<T> { | |||
| 
 | |||
|     private int resultCode; | |||
|     private T data; | |||
| 
 | |||
|     public Parcel(int resultCode, T data) { | |||
|         this.resultCode = resultCode; | |||
|         this.data = data; | |||
|     } | |||
| 
 | |||
|     public int getResultCode() { | |||
|         return resultCode; | |||
|     } | |||
| 
 | |||
|     public T getData() { | |||
|         return data; | |||
|     } | |||
| } | |||
| @ -1,51 +0,0 @@ | |||
| package gr.thmmy.mthmmy.utils.parsing; | |||
| 
 | |||
| public class Parcel<T> { | |||
| 
 | |||
|     private int resultCode; | |||
|     private T data; | |||
| 
 | |||
|     public Parcel(int resultCode, T data) { | |||
|         this.resultCode = resultCode; | |||
|         this.data = data; | |||
|     } | |||
| 
 | |||
|     public int getResultCode() { | |||
|         return resultCode; | |||
|     } | |||
| 
 | |||
|     public T getData() { | |||
|         return data; | |||
|     } | |||
| 
 | |||
|     public class ResultCode { | |||
|         /** | |||
|          * The request was successful | |||
|          */ | |||
|         public static final int SUCCESSFUL = 0; | |||
|         /** | |||
|          * Error 404, page was not found | |||
|          */ | |||
|         public static final int NOT_FOUND = 1; | |||
|         /** | |||
|          * User session ended while posting the reply | |||
|          */ | |||
|         public static final int SESSION_ENDED = 2; | |||
|         /** | |||
|          * Exception occured while parsing | |||
|          */ | |||
|         public static final int PARSE_ERROR = 3; | |||
|         /** | |||
|          * Other undefined of unidentified error | |||
|          */ | |||
|         public static final int OTHER_ERROR = 4; | |||
|         /** | |||
|          * Failed to connect to thmmy.gr | |||
|          */ | |||
|         public static final int NETWORK_ERROR = 5; | |||
|         /** | |||
|          * Error while excecuting NetworkTask's performTask() | |||
|          */ | |||
|         public static final int PERFORM_TASK_ERROR = 6; | |||
|     } | |||
| } | |||
					Loading…
					
					
				
		Reference in new issue