michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.sync; michael@0: michael@0: public class EngineSettings { michael@0: public final String syncID; michael@0: public final int version; michael@0: michael@0: public EngineSettings(final String syncID, final int version) { michael@0: this.syncID = syncID; michael@0: this.version = version; michael@0: } michael@0: michael@0: public EngineSettings(ExtendedJSONObject object) { michael@0: try { michael@0: this.syncID = object.getString("syncID"); michael@0: this.version = object.getIntegerSafely("version").intValue(); michael@0: } catch (Exception e ) { michael@0: throw new IllegalArgumentException(e); michael@0: } michael@0: } michael@0: michael@0: public ExtendedJSONObject toJSONObject() { michael@0: ExtendedJSONObject json = new ExtendedJSONObject(); michael@0: json.put("syncID", syncID); michael@0: json.put("version", version); michael@0: return json; michael@0: } michael@0: }