/** * Determine whether the actions of this permission are equal to the actions of given {@code permission}. If * the permission is not of the same type as this permission, {@code false} is returned. * * @param permission the permission whose actions are to be compared * @return {@code true} if the actions are equal, {@code false} otherwise */ @SuppressWarnings("unchecked") public final boolean actionsEquals(Permission permission) { return permission != null && permission.getClass() == getClass() && actionsEquals((This) permission); }
public final int hashCode() { return super.hashCode() * 53 + actionsHashCode(); }
/** * Get a permission which is identical to this one, but with new actions which consist of the union of the actions * from this permission and the actions from the given permission. The returned permission may or may not be a new * instance, and may be equal to this instance. * * @param permission the other permission (must not be {@code null}) * @return the permission (not {@code null}) */ public This withActionsFrom(This permission) { Assert.checkNotNullParam("permission", permission); return withActions(permission.getActions()); }
/** * Determine whether this permission implies another permission. Returns {@code true} if * both {@link #impliesActions(AbstractActionPermission)} and {@link #impliesName(AbstractNamedPermission)} * return {@code true}. * * @param permission the other permission * @return {@code true} if this permission implies the other; {@code false} otherwise */ public final boolean implies(final This permission) { return permission != null && impliesActions(permission) && impliesName(permission); }
/** * Get a permission which is identical to this one, but with new actions as given by {@code actionsString}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param permission the other permission (must not be {@code null}) * @return the permission (not {@code null}) */ public This withNewActionsFrom(This permission) { Assert.checkNotNullParam("permission", permission); return withNewActions(permission.getActions()); } }
/** * Determine whether this permission's actions value implies the actions of the given {@code permission}. If * the permission is not of the same type as this permission, {@code false} is returned. * * @param permission the permission whose actions are to be compared * @return {@code true} if this permission implies the other; {@code false} otherwise */ @SuppressWarnings("unchecked") public final boolean impliesActions(Permission permission) { return permission != null && permission.getClass() == getClass() && impliesActions((This) permission); }
/** * Determine whether this permission implies another permission. Returns {@code true} if * both {@link #impliesActions(AbstractActionPermission)} and {@link #impliesName(AbstractNamedPermission)} * return {@code true}. * * @param permission the other permission * @return {@code true} if this permission implies the other; {@code false} otherwise */ public final boolean implies(final This permission) { return permission != null && impliesActions(permission) && impliesName(permission); }
/** * Get a permission which is identical to this one, but with new actions as given by {@code actionsString}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param permission the other permission (must not be {@code null}) * @return the permission (not {@code null}) */ public This withNewActionsFrom(This permission) { Assert.checkNotNullParam("permission", permission); return withNewActions(permission.getActions()); } }
/** * Determine whether this permission's actions value implies the actions of the given {@code permission}. If * the permission is not of the same type as this permission, {@code false} is returned. * * @param permission the permission whose actions are to be compared * @return {@code true} if this permission implies the other; {@code false} otherwise */ @SuppressWarnings("unchecked") public final boolean impliesActions(Permission permission) { return permission != null && permission.getClass() == getClass() && impliesActions((This) permission); }
/** * Get a permission which is identical to this one, but with new actions which consist of the actions * from this permission without the actions from the given permission. The returned permission may or may not be a new * instance, and may be equal to this instance. * * @param permission the other permission (must not be {@code null}) * @return the permission (not {@code null}) */ public This withoutActionsFrom(This permission) { Assert.checkNotNullParam("permission", permission); return withActions(permission.getActions()); }
/** * Determine whether this permission implies another permission. Returns {@code true} if * both {@link #impliesActions(AbstractActionPermission)} and {@link #impliesName(AbstractNamedPermission)} * return {@code true}. * * @param permission the other permission * @return {@code true} if this permission implies the other; {@code false} otherwise */ public final boolean implies(final This permission) { return permission != null && impliesActions(permission) && impliesName(permission); }
/** * Get a permission which is identical to this one, but with new actions as given by {@code actionsString}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param permission the other permission (must not be {@code null}) * @return the permission (not {@code null}) */ public This withNewActionsFrom(This permission) { Assert.checkNotNullParam("permission", permission); return withNewActions(permission.getActions()); } }
/** * Determine whether this permission is equal to another permission. Returns {@code true} if * both {@link #actionsEquals(AbstractActionPermission)} and {@link #nameEquals(AbstractNamedPermission)} * return {@code true}. * * @param permission the other permission * @return {@code true} if this permission implies the other; {@code false} otherwise */ public final boolean equals(final This permission) { return super.equals(permission) && actionsEquals(permission); }
public final int hashCode() { return super.hashCode() * 53 + actionsHashCode(); }
/** * Determine whether this permission's actions value implies the actions of the given {@code permission}. If * the permission is not of the same type as this permission, {@code false} is returned. * * @param permission the permission whose actions are to be compared * @return {@code true} if this permission implies the other; {@code false} otherwise */ @SuppressWarnings("unchecked") public final boolean impliesActions(Permission permission) { return permission != null && permission.getClass() == getClass() && impliesActions((This) permission); }
/** * Get a permission which is identical to this one, but with new actions which consist of the union of the actions * from this permission and the actions from the given permission. The returned permission may or may not be a new * instance, and may be equal to this instance. * * @param permission the other permission (must not be {@code null}) * @return the permission (not {@code null}) */ public This withActionsFrom(This permission) { Assert.checkNotNullParam("permission", permission); return withActions(permission.getActions()); }
/** * Determine whether this permission implies another permission. Returns {@code true} if * both {@link #impliesActions(AbstractActionPermission)} and {@link #impliesName(AbstractNamedPermission)} * return {@code true}. * * @param permission the other permission * @return {@code true} if this permission implies the other; {@code false} otherwise */ public final boolean implies(final This permission) { return permission != null && impliesActions(permission) && impliesName(permission); }
/** * Get a permission which is identical to this one, but with new actions as given by {@code actionsString}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param permission the other permission (must not be {@code null}) * @return the permission (not {@code null}) */ public This withNewActionsFrom(This permission) { Assert.checkNotNullParam("permission", permission); return withNewActions(permission.getActions()); } }
/** * Determine whether the actions of this permission are equal to the actions of given {@code permission}. If * the permission is not of the same type as this permission, {@code false} is returned. * * @param permission the permission whose actions are to be compared * @return {@code true} if the actions are equal, {@code false} otherwise */ @SuppressWarnings("unchecked") public final boolean actionsEquals(Permission permission) { return permission != null && permission.getClass() == getClass() && actionsEquals((This) permission); }
public final int hashCode() { return super.hashCode() * 53 + actionsHashCode(); }