/** * Get a permission which is identical to this one, but with new action bits as given by {@code actionBits}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param actionBits the action bits * @return the permission (not {@code null}) */ @SuppressWarnings("unchecked") public final This withNewActionBits(int actionBits) { final int masked = actionBits & actionsMask(); if (masked == this.actionBits) { return (This) this; } else { return constructWithActionBits(masked); } }
/** * Get a permission which is identical to this one, but with new action bits as given by {@code actionBits}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param actionBits the action bits * @return the permission (not {@code null}) */ @SuppressWarnings("unchecked") public final This withNewActionBits(int actionBits) { final int masked = actionBits & actionsMask(); if (masked == this.actionBits) { return (This) this; } else { return constructWithActionBits(masked); } }
/** * Get a permission which is identical to this one, but with new action bits as given by {@code actionBits}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param actionBits the action bits * @return the permission (not {@code null}) */ @SuppressWarnings("unchecked") public final This withNewActionBits(int actionBits) { final int masked = actionBits & actionsMask(); if (masked == this.actionBits) { return (This) this; } else { return constructWithActionBits(masked); } }
/** * Get a permission which is identical to this one, but with new action bits as given by {@code actionBits}. * The returned permission may or may not be a new instance, and may be equal to this instance. * * @param actionBits the action bits * @return the permission (not {@code null}) */ @SuppressWarnings("unchecked") public final This withNewActionBits(int actionBits) { final int masked = actionBits & actionsMask(); if (masked == this.actionBits) { return (This) this; } else { return constructWithActionBits(masked); } }