Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 package org.xbmc.android.jsonrpc.api.model;
00022
00023 import android.os.Parcel;
00024 import android.os.Parcelable;
00025 import org.codehaus.jackson.JsonNode;
00026 import org.codehaus.jackson.node.ObjectNode;
00027 import org.xbmc.android.jsonrpc.api.AbstractModel;
00028
00029 public final class ConfigurationModel {
00030
00037 public static class Configuration extends AbstractModel {
00038 public final static String API_TYPE = "Configuration";
00039
00040
00041 public static final String NOTIFICATIONS = "notifications";
00042
00043
00044 public final Notifications notifications;
00045
00049 public Configuration(Notifications notifications) {
00050 this.notifications = notifications;
00051 }
00052
00053 @Override
00054 public JsonNode toJsonNode() {
00055 final ObjectNode node = OM.createObjectNode();
00056 node.put(NOTIFICATIONS, notifications.toJsonNode());
00057 return node;
00058 }
00059
00065 @Override
00066 public void writeToParcel(Parcel parcel, int flags) {
00067 parcel.writeValue(notifications);
00068 }
00069
00073 protected Configuration(Parcel parcel) {
00074 notifications = parcel.<Notifications>readParcelable(Notifications.class.getClassLoader());
00075 }
00076
00080 public static final Parcelable.Creator<Configuration> CREATOR = new Parcelable.Creator<Configuration>() {
00081 @Override
00082 public Configuration createFromParcel(Parcel parcel) {
00083 return new Configuration(parcel);
00084 }
00085 @Override
00086 public Configuration[] newArray(int n) {
00087 return new Configuration[n];
00088 }
00089 };
00090
00091 @Override
00092 public int describeContents() {
00093 return 0;
00094 }
00095 }
00096
00103 public static class Notifications extends AbstractModel {
00104 public final static String API_TYPE = "Configuration.Notifications";
00105
00106
00107 public static final String APPLICATION = "application";
00108 public static final String AUDIOLIBRARY = "audiolibrary";
00109 public static final String GUI = "gui";
00110 public static final String INPUT = "input";
00111 public static final String OTHER = "other";
00112 public static final String PLAYER = "player";
00113 public static final String PLAYLIST = "playlist";
00114 public static final String PVR = "pvr";
00115 public static final String SYSTEM = "system";
00116 public static final String VIDEOLIBRARY = "videolibrary";
00117
00118
00119 public final Boolean application;
00120 public final Boolean audiolibrary;
00121 public final Boolean gui;
00122 public final Boolean input;
00123 public final Boolean other;
00124 public final Boolean player;
00125 public final Boolean playlist;
00126 public final Boolean pvr;
00127 public final Boolean system;
00128 public final Boolean videolibrary;
00129
00142 public Notifications(Boolean application, Boolean audiolibrary, Boolean gui, Boolean input, Boolean other, Boolean player, Boolean playlist, Boolean pvr, Boolean system, Boolean videolibrary) {
00143 this.application = application;
00144 this.audiolibrary = audiolibrary;
00145 this.gui = gui;
00146 this.input = input;
00147 this.other = other;
00148 this.player = player;
00149 this.playlist = playlist;
00150 this.pvr = pvr;
00151 this.system = system;
00152 this.videolibrary = videolibrary;
00153 }
00154
00155 @Override
00156 public JsonNode toJsonNode() {
00157 final ObjectNode node = OM.createObjectNode();
00158 node.put(APPLICATION, application);
00159 node.put(AUDIOLIBRARY, audiolibrary);
00160 node.put(GUI, gui);
00161 node.put(INPUT, input);
00162 node.put(OTHER, other);
00163 node.put(PLAYER, player);
00164 node.put(PLAYLIST, playlist);
00165 node.put(PVR, pvr);
00166 node.put(SYSTEM, system);
00167 node.put(VIDEOLIBRARY, videolibrary);
00168 return node;
00169 }
00170
00176 @Override
00177 public void writeToParcel(Parcel parcel, int flags) {
00178 parcel.writeInt(application ? 1 : 0);
00179 parcel.writeInt(audiolibrary ? 1 : 0);
00180 parcel.writeInt(gui ? 1 : 0);
00181 parcel.writeInt(input ? 1 : 0);
00182 parcel.writeInt(other ? 1 : 0);
00183 parcel.writeInt(player ? 1 : 0);
00184 parcel.writeInt(playlist ? 1 : 0);
00185 parcel.writeInt(pvr ? 1 : 0);
00186 parcel.writeInt(system ? 1 : 0);
00187 parcel.writeInt(videolibrary ? 1 : 0);
00188 }
00189
00193 protected Notifications(Parcel parcel) {
00194 application = parcel.readInt() == 1;
00195 audiolibrary = parcel.readInt() == 1;
00196 gui = parcel.readInt() == 1;
00197 input = parcel.readInt() == 1;
00198 other = parcel.readInt() == 1;
00199 player = parcel.readInt() == 1;
00200 playlist = parcel.readInt() == 1;
00201 pvr = parcel.readInt() == 1;
00202 system = parcel.readInt() == 1;
00203 videolibrary = parcel.readInt() == 1;
00204 }
00205
00209 public static final Parcelable.Creator<Notifications> CREATOR = new Parcelable.Creator<Notifications>() {
00210 @Override
00211 public Notifications createFromParcel(Parcel parcel) {
00212 return new Notifications(parcel);
00213 }
00214 @Override
00215 public Notifications[] newArray(int n) {
00216 return new Notifications[n];
00217 }
00218 };
00219
00220 @Override
00221 public int describeContents() {
00222 return 0;
00223 }
00224 }
00225 }