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

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

public class PendingDeviceImpl
implements PendingDevice {
    private final String token;
    private String code;
    private JSONObject metadata;
    private RegistrationResult result;
    private PendingDevice.State state = PendingDevice.State.UNREGISTERED;

    public PendingDeviceImpl(String token) {
        this.token = token;
        this.metadata = new JSONObject();
    }

    @Nonnull
    @Override
    public String getToken() {
        return this.token;
    }

    @Nullable
    @Override
    public String getRegistrationCode() {
        return this.code;
    }

    @Nonnull
    public PendingDeviceImpl setRegistrationCode(String code) {
        this.code = code;
        return this;
    }

    @Nonnull
    @Override
    public JSONObject getMetadata() {
        return this.metadata;
    }

    @Nonnull
    public PendingDeviceImpl setMetadata(@Nonnull JSONObject metadata) {
        this.metadata = metadata;
        return this;
    }

    @Override
    public RegistrationResult getRegistrationResult() {
        return this.result;
    }

    @Nonnull
    public PendingDeviceImpl setRegistrationResult(@Nonnull RegistrationResult result) {
        this.result = result;
        return this;
    }

    @Nonnull
    @Override
    public PendingDevice.State getState() {
        return this.state;
    }

    @Nonnull
    public PendingDeviceImpl setState(PendingDevice.State state) {
        this.state = state;
        return this;
    }
}