/** * Removes the resource identified by the specified resource path from this Policy. * * @param label the label identifying the PolicyEntry to modify. * @param resourceType the type of the Resource to remove from the PolicyEntry identified by the {@code label}. * @param resourcePath the path of the Resource to remove from the PolicyEntry identified by the {@code label}. * @return a copy of this Policy with the removed subject. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code label} or {@code resourceType} is empty. */ default Policy removeResourceFor(final CharSequence label, final String resourceType, final CharSequence resourcePath) { return removeResourceFor(label, PoliciesModelFactory.newResourceKey(resourceType, resourcePath)); }
/** * Removes the specified Resource from this Policy. * * @param label the label identifying the PolicyEntry to modify. * @param resource the Resource to remove from the PolicyEntry identified by the {@code label}. * @return a copy of this Policy with the removed subject. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code label} is empty. */ default Policy removeResourceFor(final CharSequence label, final Resource resource) { return removeResourceFor(label, checkNotNull(resource, "resource").getResourceKey()); }
PoliciesValidator.newInstance(policy.removeResourceFor(label, resourceKey));
PoliciesValidator.newInstance(policy.removeResourceFor(label, resourceKey));
Policy tmpPolicy = policy; for (final ResourceKey rk : rks) { tmpPolicy = tmpPolicy.removeResourceFor(label, rk);
Policy tmpPolicy = policy; for (final ResourceKey rk : rks) { tmpPolicy = tmpPolicy.removeResourceFor(label, rk);