@Test void shouldCreateEmptyProblem() { final Problem problem = Problem.builder().build(); assertThat(problem, hasFeature("type", Problem::getType, hasToString("about:blank"))); assertThat(problem, hasFeature("title", Problem::getTitle, is(nullValue()))); assertThat(problem, hasFeature("status", Problem::getStatus, is(nullValue()))); assertThat(problem, hasFeature("detail", Problem::getDetail, is(nullValue()))); assertThat(problem, hasFeature("instance", Problem::getInstance, is(nullValue()))); }
public ThrowableProblem build() { return new DefaultProblem(type, title, status, detail, instance, cause, new LinkedHashMap<>(parameters)); }
ProblemBuilder { public ThrowableProblem build() { return new DefaultProblem(type, title, status, detail, instance, cause, new LinkedHashMap<>(parameters)); } }
ProblemBuilder { public ThrowableProblem build() { return new DefaultProblem(type, title, status, detail, instance, cause, new LinkedHashMap<>(parameters)); } ProblemBuilder(); }
ProblemBuilder { public ThrowableProblem build() { return new DefaultProblem(type, title, status, detail, instance, cause, new LinkedHashMap<>(parameters)); } ProblemBuilder(); ProblemBuilder withType(@Nullable final URI type); ProblemBuilder withTitle(@Nullable final String title); ProblemBuilder withStatus(@Nullable final StatusType status); ProblemBuilder withDetail(@Nullable final String detail); ProblemBuilder withInstance(@Nullable final URI instance); ProblemBuilder withCause(@Nullable final ThrowableProblem cause); ProblemBuilder with(final String key, final Object value); ThrowableProblem build(); }
ProblemBuilder { public ThrowableProblem build() { return new DefaultProblem(type, title, status, detail, instance, cause, new LinkedHashMap<>(parameters)); } ProblemBuilder(); ProblemBuilder withType(@Nullable final URI type); ProblemBuilder withTitle(@Nullable final String title); ProblemBuilder withStatus(@Nullable final StatusType status); ProblemBuilder withDetail(@Nullable final String detail); ProblemBuilder withInstance(@Nullable final URI instance); ProblemBuilder withCause(@Nullable final ThrowableProblem cause); ProblemBuilder with(final String key, final Object value); ThrowableProblem build();  }