001/** 002 * Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ 003 * 004 * This file is part of Dicoogle/dicoogle. 005 * 006 * Dicoogle/dicoogle is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * Dicoogle/dicoogle is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with Dicoogle. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package pt.ua.dicoogle.server.users; 020 021/** 022 * Created by bastiao on 23/01/16. 023 */ 024public class Role { 025 026 027 private String name; 028 public Role(String name) 029 { 030 this.name = name; 031 032 } 033 034 035 @Override 036 public String toString() { 037 return "Role{" + 038 "name='" + name + '\'' + 039 '}'; 040 } 041 042 public String getName() { 043 return name; 044 } 045 046 public void setName(String name) { 047 this.name = name; 048 } 049 050 051 052 @Override 053 public boolean equals(Object o) { 054 if (this == o) return true; 055 if (o == null || getClass() != o.getClass()) return false; 056 057 Role role = (Role) o; 058 059 return !(name != null ? !name.equals(role.name) : role.name != null); 060 061 } 062 063 @Override 064 public int hashCode() { 065 return name != null ? name.hashCode() : 0; 066 } 067}