001: /**********************************************************************************
002: * $URL:https://source.sakaiproject.org/svn/osp/trunk/common/api/src/java/org/theospi/portfolio/security/Authorization.java $
003: * $Id:Authorization.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.security;
021:
022: import org.sakaiproject.metaobj.shared.model.Agent;
023: import org.sakaiproject.metaobj.shared.model.Id;
024:
025: /**
026: * Created by IntelliJ IDEA.
027: * User: jbush
028: * Date: Apr 29, 2004
029: * Time: 4:58:21 PM
030: * To change this template use File | Settings | File Templates.
031: */
032: public class Authorization {
033: private Id id;
034: private Agent agent;
035: private String function;
036: private Id qualifier;
037:
038: public Authorization() {
039: }
040:
041: public Authorization(Agent agent, String function, Id qualifier) {
042: this .agent = agent;
043: this .function = function;
044: this .qualifier = qualifier;
045: }
046:
047: public Id getId() {
048: return id;
049: }
050:
051: public void setId(Id id) {
052: this .id = id;
053: }
054:
055: public Agent getAgent() {
056: return agent;
057: }
058:
059: public String getFunction() {
060: return function;
061: }
062:
063: public Id getQualifier() {
064: return qualifier;
065: }
066:
067: public void setAgent(Agent agent) {
068: this .agent = agent;
069: }
070:
071: public void setFunction(String function) {
072: this .function = function;
073: }
074:
075: public void setQualifier(Id qualifier) {
076: this .qualifier = qualifier;
077: }
078:
079: public boolean equals(Object o) {
080: if (this == o)
081: return true;
082: if (!(o instanceof Authorization))
083: return false;
084:
085: final Authorization authorization = (Authorization) o;
086:
087: if (!agent.equals(authorization.agent))
088: return false;
089: if (!function.equals(authorization.function))
090: return false;
091: if (!qualifier.equals(authorization.qualifier))
092: return false;
093:
094: return true;
095: }
096:
097: public int hashCode() {
098: int result;
099: result = agent.hashCode();
100: result = 29 * result + function.hashCode();
101: result = 29 * result + qualifier.hashCode();
102: return result;
103: }
104:
105: }
|