RegistrationResultImpl.java 1.83 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.annotation.Nonnull
 *  org.apache.sling.commons.json.JSONException
 *  org.apache.sling.commons.json.JSONObject
 */
package com.adobe.cq.screens.device.registration.impl;

import com.adobe.cq.screens.device.registration.RegistrationResult;
import javax.annotation.Nonnull;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;

public class RegistrationResultImpl
extends JSONObject
implements RegistrationResult {
    public final String DEVICE_CODE = "deviceCode";
    public final String DEVICE_ID = "deviceId";
    public final String DEVICE_PATH = "devicePath";
    public final String PASSWORD = "password";
    public final String USER = "user";

    @Nonnull
    public RegistrationResultImpl setDeviceId(@Nonnull String id) {
        try {
            this.put("deviceId", (Object)id);
            this.put("user", (Object)id);
        }
        catch (JSONException e) {
            // empty catch block
        }
        return this;
    }

    @Nonnull
    @Override
    public String getDeviceId() {
        return this.optString("deviceId");
    }

    public RegistrationResultImpl setDevicePath(String path) {
        try {
            this.put("devicePath", (Object)path);
        }
        catch (JSONException e) {
            // empty catch block
        }
        return this;
    }

    @Override
    public String getDevicePath() {
        return this.optString("devicePath");
    }

    public RegistrationResultImpl setPassword(String pwd) {
        try {
            this.put("password", (Object)pwd);
        }
        catch (JSONException e) {
            // empty catch block
        }
        return this;
    }

    @Override
    public String getPassword() {
        return this.optString("password");
    }
}