123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- /*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
- package org.sonar.core.permission;
-
- import javax.annotation.CheckForNull;
- import javax.annotation.Nullable;
- import org.apache.commons.lang.builder.ToStringBuilder;
- import org.apache.commons.lang.builder.ToStringStyle;
-
- public class GroupWithPermission {
-
- private long id;
- private String name;
- private String description;
- private boolean hasPermission;
-
- public long id() {
- return id;
- }
-
- public GroupWithPermission setId(Long id) {
- this.id = id;
- return this;
- }
-
- public String name() {
- return name;
- }
-
- public GroupWithPermission setName(String name) {
- this.name = name;
- return this;
- }
-
- @CheckForNull
- public String description() {
- return description;
- }
-
- public GroupWithPermission setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- public boolean hasPermission() {
- return hasPermission;
- }
-
- public GroupWithPermission hasPermission(boolean hasPermission) {
- this.hasPermission = hasPermission;
- return this;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- GroupWithPermission that = (GroupWithPermission) o;
- return name.equals(that.name);
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
- }
|