Fixing bad merge.

This commit is contained in:
ojiikun 2013-07-02 08:58:41 +00:00
parent 98ea0b4892
commit 130ceea9ad
3 changed files with 0 additions and 58 deletions

View file

@ -1,35 +0,0 @@
package com.newsblur.network.domain;
/**
* A generic response to an API call that only encapsuates success versus failure.
*/
public class NewsBlurResponse {
public boolean authenticated;
public int code;
public String message;
public ResponseErrors errors;
public String result;
public boolean isError() {
if (message != null) return true;
if ((errors != null) && (errors.message.length > 0) && (errors.message[0] != null)) return true;
return false;
}
/**
* Gets the error message returned by the API, or defaultMessage if none was found.
*/
public String getErrorMessage(String defaultMessage) {
if (message != null) return message;
if ((errors != null) && (errors.message.length > 0) && (errors.message[0] != null)) return errors.message[0];
return defaultMessage;
}
/**
* Gets the error message returned by the API, or a simple numeric error code if non was found.
*/
public String getErrorMessage() {
return getErrorMessage(Integer.toString(code));
}
}

View file

@ -1,8 +0,0 @@
package com.newsblur.network.domain;
public class RegisterResponse extends NewsBlurResponse {
public String[] email;
public String[] username;
}

View file

@ -1,15 +0,0 @@
package com.newsblur.network.domain;
import com.google.gson.annotations.SerializedName;
public class ResponseErrors {
@SerializedName("__all__")
public String[] message;
@SerializedName("email")
public String[] email;
@SerializedName("username")
public String[] username;
}