/*
 * Copyright 2014 CyberVision, Inc.
 *
 * 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.
 */

package org.kaaproject.kaa.common.dto.admin;

import java.io.Serializable;
import java.util.List;

import org.kaaproject.kaa.common.dto.HasId;

public class SdkPropertiesDto implements HasId, Serializable {

    private static final long serialVersionUID = 2433663439327120870L;

    public static final String SDK_KEY_PARAMETER = "sdkKey";

    private String id;
    private String applicationId;
    private Integer configurationSchemaVersion;
    private Integer profileSchemaVersion;
    private Integer notificationSchemaVersion;
    private Integer logSchemaVersion;
    private SdkPlatform targetPlatform;
    private List<String> aefMapIds;
    private String defaultVerifierToken;
    private String applicationToken;

    public SdkPropertiesDto() {
    }

    public SdkPropertiesDto(String applicationId, Integer configurationSchemaVersion,
                            Integer profileSchemaVersion, Integer notificationSchemaVersion,
                            Integer logSchemaVersion,
                            SdkPlatform targetPlatform, List<String> aefMapIds,
                            String defaultVerifierToken, String applicationToken) {
        super();
        this.applicationId = applicationId;
        this.configurationSchemaVersion = configurationSchemaVersion;
        this.profileSchemaVersion = profileSchemaVersion;
        this.notificationSchemaVersion = notificationSchemaVersion;
        this.logSchemaVersion = logSchemaVersion;
        this.targetPlatform = targetPlatform;
        this.aefMapIds = aefMapIds;
        this.defaultVerifierToken = defaultVerifierToken;
        this.applicationToken = applicationToken;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public Integer getConfigurationSchemaVersion() {
        return configurationSchemaVersion;
    }

    public void setConfigurationSchemaVersion(Integer configurationSchemaVersion) {
        this.configurationSchemaVersion = configurationSchemaVersion;
    }

    public Integer getProfileSchemaVersion() {
        return profileSchemaVersion;
    }

    public void setProfileSchemaVersion(Integer profileSchemaVersion) {
        this.profileSchemaVersion = profileSchemaVersion;
    }

    public Integer getNotificationSchemaVersion() {
        return notificationSchemaVersion;
    }

    public void setNotificationSchemaVersion(Integer notificationSchemaVersion) {
        this.notificationSchemaVersion = notificationSchemaVersion;
    }

    public SdkPlatform getTargetPlatform() {
        return targetPlatform;
    }

    public void setTargetPlatform(SdkPlatform targetPlatform) {
        this.targetPlatform = targetPlatform;
    }

    public List<String> getAefMapIds() {
        return aefMapIds;
    }

    public void setAefMapIds(List<String> aefMapIds) {
        this.aefMapIds = aefMapIds;
    }

    public Integer getLogSchemaVersion() {
        return logSchemaVersion;
    }

    public void setLogSchemaVersion(Integer logSchemaVersion) {
        this.logSchemaVersion = logSchemaVersion;
    }
    
    public String getDefaultVerifierToken() {
        return defaultVerifierToken;
    }

    public void setDefaultVerifierToken(String defaultVerifierToken) {
        this.defaultVerifierToken = defaultVerifierToken;
    }

    public String getApplicationToken() {
        return applicationToken;
    }

    public void setApplicationToken(String applicationToken) {
        this.applicationToken = applicationToken;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SdkPropertiesDto that = (SdkPropertiesDto) o;

        if (aefMapIds != null ? !aefMapIds.equals(that.aefMapIds) : that.aefMapIds != null) {
            return false;
        }
        if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null)  {
            return false;
        }
        if (applicationToken != null ? !applicationToken.equals(that.applicationToken) : that.applicationToken != null) {
            return false;
        }
        if (configurationSchemaVersion != null ? !configurationSchemaVersion.equals(that.configurationSchemaVersion) : that.configurationSchemaVersion != null) {
            return false;
        }
        if (defaultVerifierToken != null ? !defaultVerifierToken.equals(that.defaultVerifierToken) : that.defaultVerifierToken != null) {
            return false;
        }
        if (logSchemaVersion != null ? !logSchemaVersion.equals(that.logSchemaVersion) : that.logSchemaVersion != null) {
            return false;
        }
        if (notificationSchemaVersion != null ? !notificationSchemaVersion.equals(that.notificationSchemaVersion) : that.notificationSchemaVersion != null) {
            return false;
        }
        if (profileSchemaVersion != null ? !profileSchemaVersion.equals(that.profileSchemaVersion) : that.profileSchemaVersion != null) {
            return false;
        }
        if (targetPlatform != that.targetPlatform) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = applicationId != null ? applicationId.hashCode() : 0;
        result = 31 * result + (configurationSchemaVersion != null ? configurationSchemaVersion.hashCode() : 0);
        result = 31 * result + (profileSchemaVersion != null ? profileSchemaVersion.hashCode() : 0);
        result = 31 * result + (notificationSchemaVersion != null ? notificationSchemaVersion.hashCode() : 0);
        result = 31 * result + (logSchemaVersion != null ? logSchemaVersion.hashCode() : 0);
        result = 31 * result + (targetPlatform != null ? targetPlatform.hashCode() : 0);
        result = 31 * result + (aefMapIds != null ? aefMapIds.hashCode() : 0);
        result = 31 * result + (defaultVerifierToken != null ? defaultVerifierToken.hashCode() : 0);
        result = 31 * result + (applicationToken != null ? applicationToken.hashCode() : 0);
        return result;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

}

@@ -6789,32 +6789,764 @@
  result;%0A    %7D%0A%0A
+    @Override%0A    public String toString() %7B%0A        return %22SdkPropertiesDto%7B%22 +%0A                %22id='%22 + id + '%5C'' +%0A                %22, applicationId='%22 + applicationId + '%5C'' +%0A                %22, configurationSchemaVersion=%22 + configurationSchemaVersion +%0A                %22, profileSchemaVersion=%22 + profileSchemaVersion +%0A                %22, notificationSchemaVersion=%22 + notificationSchemaVersion +%0A                %22, logSchemaVersion=%22 + logSchemaVersion +%0A                %22, targetPlatform=%22 + targetPlatform +%0A                %22, aefMapIds=%22 + aefMapIds +%0A                %22, defaultVerifierToken='%22 + defaultVerifierToken + '%5C'' +%0A                %22, applicationToken='%22 + applicationToken + '%5C'' +%0A                '%7D';%0A    %7D%0A%0A
     @Override%0A  

add toString() to SdkPropertiesDto