Make sure invokeOperation is set once
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / authorization / ResourceGroup.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.sal.authorization;
11
12 import java.io.Serializable;
13
14 /**
15  * Represents a group of resources along with the privilege associated to it
16  *
17  *
18  *
19  */
20 @Deprecated
21 public class ResourceGroup implements Serializable {
22     private static final long serialVersionUID = 1L;
23     private String groupName; // the resource group name
24     private Privilege privilege; // the privilege for this profile on the resource group
25
26     public ResourceGroup(String groupName, Privilege privilege) {
27         this.groupName = groupName;
28         this.privilege = privilege;
29     }
30
31     /**
32      * Returns the name for this resource group
33      * @return
34      */
35     public String getGroupName() {
36         return groupName;
37     }
38
39     /**
40      * Returns the privilege for this group on its resources
41      * @return
42      */
43     public Privilege getPrivilege() {
44         return privilege;
45     }
46
47     @Override
48     public int hashCode() {
49         final int prime = 31;
50         int result = 1;
51         result = prime * result
52                 + ((groupName == null) ? 0 : groupName.hashCode());
53         result = prime * result
54                 + ((privilege == null) ? 0 : privilege.hashCode());
55         return result;
56     }
57
58     @Override
59     public boolean equals(Object obj) {
60         if (this == obj)
61             return true;
62         if (obj == null)
63             return false;
64         if (getClass() != obj.getClass())
65             return false;
66         ResourceGroup other = (ResourceGroup) obj;
67         if (groupName == null) {
68             if (other.groupName != null)
69                 return false;
70         } else if (!groupName.equals(other.groupName))
71             return false;
72         if (privilege != other.privilege)
73             return false;
74         return true;
75     }
76
77     @Override
78     public String toString() {
79         return "[" + groupName + ", " + privilege.toString() + "]";
80     }
81 }