+/*
+ * <p>AMIES Android<br/>
+ * Copyright (C) 2016 Adullact.</p>
+ *
+ * <p>This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.</p>
+ *
+ * <p>This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.</p>
+ *
+ * <p>You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.</p>
+ */
package org.adullact.amies.models;
+import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
@SerializedName("code") private String mCode;
@SerializedName("image") private String mImage;
@SerializedName("email") private String mMail;
+ @SerializedName("collectivity") private JsonObject mSubObject;
// <editor-fold desc="Setters / Getters">
public String getId() {
- return mId;
- }
-
- public void setId(String id) {
- mId = id;
+ return (mSubObject != null) ? ((mSubObject.get("id") != null) ? mSubObject.get("id").getAsString() : mId) : mId;
}
public String getName() {
- return mName;
- }
-
- public void setName(String name) {
- mName = name;
- }
-
- public String getType() {
- return mType;
- }
-
- public void setType(String type) {
- mType = type;
- }
-
- public String getCode() {
- return mCode;
- }
-
- public void setCode(String code) {
- mCode = code;
- }
-
- public String getImage() {
- return mImage;
- }
-
- public void setImage(String image) {
- mImage = image;
+ return (mSubObject != null) ? ((mSubObject.get("name") != null) ? mSubObject.get("name").getAsString() : mName) : mName;
}
public String getMail() {
return mMail;
}
- public void setMail(String mail) {
- mMail = mail;
- }
-
// </editor-fold desc="Setters / Getters">
}