/*
 * 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 this theme
     */
    public String getName() {
        return name;
    }

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

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

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

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

@@ -1497,16 +1497,18 @@
 Object o
+bj
 ) %7B%0A    
@@ -1524,17 +1524,33 @@
 his == o
-)
+bj) %7B%0A           
  return 
@@ -1555,16 +1555,26 @@
 n true;%0A
+        %7D%0A
         
@@ -1580,16 +1580,18 @@
  if (!(o
+bj
  instanc
@@ -1601,16 +1601,30 @@
  Theme))
+ %7B%0A           
  return 
@@ -1630,16 +1630,26 @@
  false;%0A
+        %7D%0A
         
@@ -1671,16 +1671,18 @@
 Theme) o
+bj
 ;%0A      
@@ -1718,24 +1718,60 @@
  theme.name)
+ && Objects.equals(path, theme.path)
 ;%0A    %7D%0A%0A   
@@ -1841,16 +1841,22 @@
 ash(name
+, path
 );%0A    %7D
@@ -1928,70 +1928,50 @@
 eme%7B
-%22 +%0A               %22name='%22 + name + '%5C'' +%0A               '%7D'
+name='%22 + name + %22', path='%22 + path + %22'%7D%22
 ;%0A  

fix equals, hashCode, toString methods in Theme class