Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d0924bd authored by Bartosz Przybylski's avatar Bartosz Przybylski
Browse files

Add and use getters for data wrappers

parent 901b8fd6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -40,4 +40,16 @@ public class OCSMeta {
    @SerializedName("message")
    public String message;
    // TODO(bp): add paging information

    public String getStatus() {
        return status;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getMessage() {
        return message;
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -38,4 +38,12 @@ public class OCSResponse<T extends Object> {

    @SerializedName("meta")
    public OCSMeta meta;

    public T getData() {
        return data;
    }

    public OCSMeta getMeta() {
        return meta;
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -35,4 +35,8 @@ import com.google.gson.annotations.SerializedName;
public class ServerResponse<T extends Object> {
    @SerializedName("ocs")
    public OCSResponse<T> ocs;

    public OCSResponse<T> getOcs() {
        return ocs;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ public class GetRemoteUserInfoOperation extends RemoteOperation {
                Type respType = new TypeToken<ServerResponse<UserInfo>>(){}.getType();
                ServerResponse<UserInfo> ocsResponse = gson.fromJson(respJson, respType);

                UserInfo userInfo = ocsResponse.ocs.data;
                UserInfo userInfo = ocsResponse.getOcs().getData();

                if (userInfo.getId() == null) {
                    if (TextUtils.isEmpty(userID))