package com.arrebol.taxiservicios.model.core;

import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

public class Permission implements java.io.Serializable {

    private static final long serialVersionUID = 8906768919317843915L;

    private String id;
    private String name;
    private String description;
    private String menuPath;
    private Integer leftToRightOrder;
    private Integer topToBottomOrder;
    private boolean generalAccess;
    private boolean applicationMenu;
    private boolean active;
    private String parentName;
    private Set userHasPermissions = new HashSet(0);

    public Permission() {
    }

    public String getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public String getDescription() {
        return description;
    }

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

    public String getMenuPath() {
        return menuPath;
    }

    public void setMenuPath(String menuPath) {
        this.menuPath = menuPath;
    }

    public Integer getLeftToRightOrder() {
        return leftToRightOrder;
    }

    public void setLeftToRightOrder(Integer leftToRightOrder) {
        this.leftToRightOrder = leftToRightOrder;
    }

    public Integer getTopToBottomOrder() {
        return topToBottomOrder;
    }

    public void setTopToBottomOrder(Integer topToBottomOrder) {
        this.topToBottomOrder = topToBottomOrder;
    }

    public boolean isGeneralAccess() {
        return generalAccess;
    }

    public void setGeneralAccess(boolean generalAccess) {
        this.generalAccess = generalAccess;
    }

    public boolean isApplicationMenu() {
        return applicationMenu;
    }

    public void setApplicationMenu(boolean applicationMenu) {
        this.applicationMenu = applicationMenu;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Set getUserHasPermissions() {
        return userHasPermissions;
    }

    public void setUserHasPermissions(Set userHasPermissions) {
        this.userHasPermissions = userHasPermissions;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 79 * hash + Objects.hashCode(this.id);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Permission other = (Permission) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Permission{" + "description=" + description + ", leftToRightOrder=" + leftToRightOrder + ", topToBottomOrder=" + topToBottomOrder + '}';
    }
}
