/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectId} in the {@link Label} is replaced by the specified one. * * @param issuer the SubjectId's {@code issuer}. * @param subject the character sequence for the SubjectId's {@code subject}. * @param subjectType the type of the subject to set. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final SubjectIssuer issuer, final CharSequence subject, final SubjectType subjectType) { setSubjectFor(getLabel(), Subject.newInstance(issuer, subject, subjectType)); return this; }
/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectId} in the {@link Label} is replaced by the specified one. Sets the subject type * to {@link SubjectType#GENERATED}. * * @param issuer the SubjectId's {@code issuer}. * @param subject the character sequence for the SubjectId's {@code subject}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final SubjectIssuer issuer, final CharSequence subject) { setSubjectFor(getLabel(), Subject.newInstance(issuer, subject)); return this; }
/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectIssuerWithId} in the {@link Label} is replaced by the specified one. * * @param subjectIssuerWithId the Subject issuer + Subject ID (separated with a "{@value * SubjectId#ISSUER_DELIMITER}") of the Subject to set. * @param subjectType the type of the subject to set. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final CharSequence subjectIssuerWithId, final SubjectType subjectType) { setSubjectFor(getLabel(), Subject.newInstance(subjectIssuerWithId, subjectType)); return this; }
/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectId} in the {@link Label} is replaced by the specified one. * * @param subject the Subject to set for the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final Subject subject) { setSubjectFor(getLabel(), subject); return this; }