/** * Converts a TablePermission proto to a client TablePermission object. * @param proto the protobuf TablePermission * @return the converted TablePermission */ public static TablePermission toTablePermission(AccessControlProtos.TablePermission proto) { List<Permission.Action> actions = toPermissionActions(proto.getActionList()); TableName table = null; byte[] qualifier = null; byte[] family = null; if (!proto.hasTableName()) { throw new IllegalStateException("TableName cannot be empty"); } table = ProtobufUtil.toTableName(proto.getTableName()); if (proto.hasFamily()) { family = proto.getFamily().toByteArray(); } if (proto.hasQualifier()) { qualifier = proto.getQualifier().toByteArray(); } return new TablePermission(table, family, qualifier, actions.toArray(new Permission.Action[actions.size()])); }
List<Permission.Action> actions = toPermissionActions(perm.getActionList()); byte[] qualifier = null; byte[] family = null;
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasTableName()) { hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); } if (hasFamily()) { hash = (37 * hash) + FAMILY_FIELD_NUMBER; hash = (53 * hash) + getFamily().hashCode(); } if (hasQualifier()) { hash = (37 * hash) + QUALIFIER_FIELD_NUMBER; hash = (53 * hash) + getQualifier().hashCode(); } if (getActionCount() > 0) { hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + hashEnumList(getActionList()); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
List<Permission.Action> actions = toPermissionActions(perm.getActionList());
.equals(other.getQualifier()); result = result && getActionList() .equals(other.getActionList()); result = result && getUnknownFields().equals(other.getUnknownFields());
List<Permission.Action> actions = toPermissionActions(perm.getActionList());
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasTableName()) { hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); } if (hasFamily()) { hash = (37 * hash) + FAMILY_FIELD_NUMBER; hash = (53 * hash) + getFamily().hashCode(); } if (hasQualifier()) { hash = (37 * hash) + QUALIFIER_FIELD_NUMBER; hash = (53 * hash) + getQualifier().hashCode(); } if (getActionCount() > 0) { hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + hashEnumList(getActionList()); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
.equals(other.getQualifier()); result = result && getActionList() .equals(other.getActionList()); result = result && getUnknownFields().equals(other.getUnknownFields());
.equals(other.getQualifier()); result = result && getActionList() .equals(other.getActionList()); result = result && getUnknownFields().equals(other.getUnknownFields());
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasTableName()) { hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); } if (hasFamily()) { hash = (37 * hash) + FAMILY_FIELD_NUMBER; hash = (53 * hash) + getFamily().hashCode(); } if (hasQualifier()) { hash = (37 * hash) + QUALIFIER_FIELD_NUMBER; hash = (53 * hash) + getQualifier().hashCode(); } if (getActionCount() > 0) { hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + hashEnumList(getActionList()); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasTableName()) { hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); } if (hasFamily()) { hash = (37 * hash) + FAMILY_FIELD_NUMBER; hash = (53 * hash) + getFamily().hashCode(); } if (hasQualifier()) { hash = (37 * hash) + QUALIFIER_FIELD_NUMBER; hash = (53 * hash) + getQualifier().hashCode(); } if (getActionCount() > 0) { hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + hashEnumList(getActionList()); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
List<Permission.Action> actions = toPermissionActions(perm.getActionList());
.equals(other.getQualifier()); result = result && getActionList() .equals(other.getActionList()); result = result && getUnknownFields().equals(other.getUnknownFields());