/*
 * 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;

public class Page implements Comparable<Page> {

    private final UriPatten uriPatten;
    private final String content;

    public Page(UriPatten uriPatten, String content) {
        this.uriPatten = uriPatten;
        this.content = content;
    }

    public UriPatten getUriPatten() {
        return uriPatten;
    }

    public String getContent() {
        return content;
    }

    @Override
    public int compareTo(Page otherPage) {
        return (otherPage == null) ? 1 : this.getUriPatten().compareTo(otherPage.getUriPatten());
    }

    @Override
    public boolean equals(Object obj) {
        return (this == obj) || ((obj instanceof Page) && (this.compareTo((Page) obj) == 0));
    }

    @Override
    public int hashCode() {
        return Objects.hash(uriPatten, content);
    }

    @Override
    public String toString() {
        return "Page{" +
               "uriPatten=" + uriPatten +
               '}';
    }
}

@@ -728,16 +728,78 @@
 jects;%0A%0A
+/**%0A * Represents a page of a web app.%0A *%0A * @since 0.8.0%0A */%0A
 public c
@@ -921,204 +921,553 @@
     
-public Page(UriPatten uriPatten, String content) %7B%0A        this.uriPatten = uriPatten;%0A        this.content = content;%0A    %7D%0A%0A    public UriPatten getUriPatten() %7B%0A        return uriPatten;%0A    %7D%0A
+/**%0A     * Creates a new page.%0A     *%0A     * @param uriPatten URI pattern of the page%0A     * @param content   content of the page%0A     */%0A    public Page(UriPatten uriPatten, String content) %7B%0A        this.uriPatten = uriPatten;%0A        this.content = content;%0A    %7D%0A%0A    /**%0A     * Returns the URI pattern of this page.%0A     *%0A     * @return URI pattern of this page%0A     */%0A    public UriPatten getUriPatten() %7B%0A        return uriPatten;%0A    %7D%0A%0A    /**%0A     * Returns the content of this page.%0A     *%0A     * @return content of the page%0A     */
 %0A   
@@ -2012,28 +2012,8 @@
 age%7B
-%22 +%0A               %22
 uriP
@@ -2037,27 +2037,39 @@
 en +
-%0A               '%7D'
+ %22, content='%22 + content + %22'%7D%22
 ;%0A  

fix javadocs in Page class