/** * Returns a mutable builder with a fluent API for an immutable {@link Policy}. * * @param id the ID of the new Policy. * @return the new builder. * @throws PolicyIdInvalidException if {@code id} is invalid. */ public static PolicyBuilder newPolicyBuilder(final CharSequence id) { return ImmutablePolicyBuilder.of(id); }
/** * Returns a mutable builder for a {@code Policy} based on the given {@code existingPolicy}. * * @param existingPolicy the existing Policy to instantiate the builder with. * @return the new builder. */ public static PolicyBuilder newPolicyBuilder(final Policy existingPolicy) { return ImmutablePolicyBuilder.of(existingPolicy); }
/** * Returns a mutable builder with a fluent API for an immutable {@link Policy}. The builder is initialised * with the given Policy entries. * * @param id the ID of the new Policy. * @param policyEntries the initial entries of the new builder. * @return the new builder. * @throws NullPointerException if {@code policyEntries} is {@code null}. * @throws org.eclipse.ditto.model.policies.PolicyIdInvalidException if {@code id} is invalid. */ public static PolicyBuilder newPolicyBuilder(final CharSequence id, final Iterable<PolicyEntry> policyEntries) { return ImmutablePolicyBuilder.of(id, policyEntries); }