/** * Returns a new {@link SubjectType} with the specified {@code subjectType}. * * @param subjectType the SubjectType char sequence. * @return the new {@link SubjectType}. * @throws NullPointerException if {@code subjectType} is {@code null}. */ static SubjectType newInstance(final CharSequence subjectType) { return PoliciesModelFactory.newSubjectType(subjectType); }
private static Subject createSubjectForPut(final String jsonString, final CharSequence subjectId) { final JsonObject jsonObject = wrapJsonRuntimeException(() -> JsonFactory.newObject(jsonString)); final String subjectTypeString = jsonObject.getValueOrThrow(Subject.JsonFields.TYPE); final SubjectType subjectType = PoliciesModelFactory.newSubjectType(subjectTypeString); return PoliciesModelFactory.newSubject(SubjectId.newInstance(subjectId), subjectType); }