/*
 * Copyright (c) 2017, 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.uis.api;

import java.util.Objects;

/**
 * Represents a theme in a web app.
 *
 * @since 0.8.0
 */
public class Theme {

    private final String name;
    private final String path;

    /**
     * Creates a new theme which can be located in the specified path.
     *
     * @param name name of the theme
     * @param path path to the theme
     */
    public Theme(String name, String path) {
        this.name = name;
        this.path = path;
    }

    /**
     * Returns the name of this theme.
     *
     * @return name of the theme
     */
    public String getName() {
        return name;
    }

    /**
     * Returns the path of this theme.
     *
     * @return path of the theme
     */
    public String getPath() {
        return path;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Theme)) {
            return false;
        }
        Theme theme = (Theme) obj;
        return Objects.equals(name, theme.name) && Objects.equals(path, theme.path);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, path);
    }

    @Override
    public String toString() {
        return "Theme{name='" + name + "', path='" + path + "'}";
    }
}

@@ -1516,18 +1516,22 @@
         
-if
+return
  (this =
@@ -1541,58 +1541,12 @@
 bj) 
-%7B%0A            return true;%0A        %7D%0A        if
+%7C%7C
  (
-!
 (obj
@@ -1567,97 +1567,11 @@
 eme)
-) %7B%0A            return false;%0A        %7D%0A        Theme theme = (Theme) obj;%0A        return
+ &&
  Obj
@@ -1592,54 +1592,27 @@
 me, 
-t
+((T
 heme
+) obj)
 .name)
- && Objects.equals(path, theme.path
 );%0A 
@@ -1655,24 +1655,24 @@
 ashCode() %7B%0A
+
         retu
@@ -1691,22 +1691,16 @@
 ash(name
-, path
 );%0A    %7D

change equals() and hashCode() methods in Theme class to use only name