/*
*  Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
*  WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.api.model;

import java.io.Serializable;
import java.util.Objects;

public class Scope implements Serializable{

    String key;
    String name;
    String roles;
    String description;
    int id;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRoles() {
        return roles;
    }

    public void setRoles(String roles) {
        this.roles = roles;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) return true;
        return obj instanceof Scope && key.equals(((Scope) obj).getKey()) && name.equals(((Scope) obj).getName()) &&
                roles.equals(((Scope) obj).getRoles()) && description.equals(((Scope) obj).getDescription());
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, name, roles, description, id);
    }
}

@@ -1615,18 +1615,16 @@
 Object o
-bj
 ) %7B%0A    
@@ -1635,19 +1635,17 @@
 if (
-obj == this
+this == o
 ) re
@@ -1667,39 +1667,157 @@
     
-return obj instanceof Scope && 
+if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A        Scope scope = (Scope) o;%0A%0A        if (id != scope.id) return false;%0A        if (!
 key.
@@ -1827,35 +1827,47 @@
 als(
-((S
+s
 cope
-) obj).getKey()) && 
+.key)) return false;%0A        if (!
 name
@@ -1878,52 +1878,64 @@
 als(
-((S
+s
 cope
-) obj).getN
+.n
 ame
-(
 )) 
-&&%0A                
+return false;%0A        if (roles != null ? !
 role
@@ -1947,36 +1947,94 @@
 als(
-((S
+s
 cope
-) obj).getRoles()) &&
+.roles) : scope.roles != null) return false;%0A        return description != null ?
  des
@@ -2053,26 +2053,36 @@
 als(
-((S
+s
 cope
-) obj).getD
+.description) : scope.d
 escr
@@ -2087,19 +2087,24 @@
 cription
-())
+ == null
 ;%0A    %7D%0A

Fix null values in description column