3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
10 package org.opendaylight.controller.sal.authorization;
12 import java.io.Serializable;
14 import org.apache.commons.lang3.builder.EqualsBuilder;
15 import org.apache.commons.lang3.builder.HashCodeBuilder;
18 * Represents a group of resources along with the privilege associated to it
23 public class ResourceGroup implements Serializable {
24 private static final long serialVersionUID = 1L;
25 private String groupName; // the resource group name
26 private Privilege privilege; // the privilege for this profile on the resource group
28 public ResourceGroup(String groupName, Privilege privilege) {
29 this.groupName = groupName;
30 this.privilege = privilege;
34 * Returns the name for this resource group
37 public String getGroupName() {
42 * Returns the privilege for this group on its resources
45 public Privilege getPrivilege() {
50 public int hashCode() {
51 return HashCodeBuilder.reflectionHashCode(this);
55 public boolean equals(Object obj) {
56 return EqualsBuilder.reflectionEquals(this, obj);
60 public String toString() {
61 return "[" + groupName + ", " + privilege.toString() + "]";