/* * Copyright 2011 Future Systems, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.krakenapps.dom.model; import org.krakenapps.api.FieldOption; import org.krakenapps.confdb.CollectionName; @CollectionName("permission") public class Permission { @FieldOption(nullable = false, length = 60) private String group; @FieldOption(nullable = false, length = 60) private String permission; @FieldOption(length = 255) private String description; public Permission() { } public Permission(String group, String permission) { this.group = group; this.permission = permission; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((group == null) ? 0 : group.hashCode()); result = prime * result + ((permission == null) ? 0 : permission.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Permission other = (Permission) obj; if (group == null) { if (other.group != null) return false; } else if (!group.equals(other.group)) return false; if (permission == null) { if (other.permission != null) return false; } else if (!permission.equals(other.permission)) return false; return true; } public String getGroup() { return group; } public void setGroup(String group) { this.group = group; } public String getPermission() { return permission; } public void setPermission(String permission) { this.permission = permission; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }