mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fixing bad merge.
This commit is contained in:
parent
98ea0b4892
commit
130ceea9ad
3 changed files with 0 additions and 58 deletions
|
@ -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));
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package com.newsblur.network.domain;
|
||||
|
||||
public class RegisterResponse extends NewsBlurResponse {
|
||||
|
||||
public String[] email;
|
||||
public String[] username;
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
Loading…
Add table
Reference in a new issue