package com.devicehive.model.rpc;

/*
 * #%L
 * DeviceHive Common Module
 * %%
 * Copyright (C) 2016 DataArt
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
import com.devicehive.shim.api.Body;

import java.util.Date;
import java.util.Objects;
import java.util.Set;

public class CommandSubscribeRequest extends Body {

    private String subscriptionId;
    private String device;
    private Set<String> names;
    private Date timestamp;
    private Integer limit;

    public CommandSubscribeRequest(String subscriptionId, String device, Set<String> names, Date timestamp, Integer limit) {
        super(Action.COMMAND_SUBSCRIBE_REQUEST.name());
        this.subscriptionId = subscriptionId;
        this.device = device;
        this.names = names;
        this.timestamp = timestamp;
        this.limit = limit;
    }

    public String getSubscriptionId() {
        return subscriptionId;
    }

    public void setSubscriptionId(String subscriptionId) {
        this.subscriptionId = subscriptionId;
    }

    public String getDevice() {
        return device;
    }

    public void setDevice(String device) {
        this.device = device;
    }

    public Set<String> getNames() {
        return names;
    }

    public void setNames(Set<String> names) {
        this.names = names;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof CommandSubscribeRequest)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        CommandSubscribeRequest that = (CommandSubscribeRequest) o;
        return Objects.equals(subscriptionId, that.subscriptionId)
                && Objects.equals(device, that.device)
                && Objects.equals(names, that.names)
                && Objects.equals(timestamp, that.timestamp);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), subscriptionId, device, names, timestamp);
    }

    @Override
    public String toString() {
        return "CommandSubscribeRequest{" + "subscriptionId=" + subscriptionId + ", device=" + device + ", names=" + names + ", timestamp=" + timestamp + ", limit=" + limit + '}';
    }
}

@@ -1061,16 +1061,28 @@
  device,
+%0A           
  Set%3CStr
@@ -2936,16 +2936,32 @@
 equest%7B%22
+%0A               
  + %22subs
@@ -2971,16 +2971,17 @@
 ptionId=
+'
 %22 + subs
@@ -2992,16 +2992,39 @@
 tionId +
+ '%5C''%0A                +
  %22, devi
@@ -3026,16 +3026,17 @@
  device=
+'
 %22 + devi
@@ -3039,16 +3039,39 @@
 device +
+ '%5C''%0A                +
  %22, name
@@ -3081,16 +3081,32 @@
  + names
+%0A               
  + %22, ti
@@ -3126,16 +3126,32 @@
 imestamp
+%0A               
  + %22, li
@@ -3163,16 +3163,32 @@
  + limit
+%0A               
  + '%7D';%0A

fix long code lines