Home / Function/ when() — spring-boot Function Reference

when() — spring-boot Function Reference

Architecture documentation for the when() function in JsonWriterTests.java from the spring-boot codebase.

Function java GradlePlugin DslExtensions calls 1 called by 4

Entity Profile

Dependency Diagram

graph TD
  f620c002_62d4_28c9_f35a_46baa1bba84f["when()"]
  8ea4c37c_1dd2_79b7_c690_a4fbac2e56d7["chainedAsAndPredicates()"]
  8ea4c37c_1dd2_79b7_c690_a4fbac2e56d7 -->|calls| f620c002_62d4_28c9_f35a_46baa1bba84f
  de75da99_e8eb_8a9c_178a_a7e34c7c52cb["whenWhenPredicateMatches()"]
  de75da99_e8eb_8a9c_178a_a7e34c7c52cb -->|calls| f620c002_62d4_28c9_f35a_46baa1bba84f
  e19ae8f1_c7fa_17ac_b15d_15524e289863["whenWhenPredicateDoesNotMatch()"]
  e19ae8f1_c7fa_17ac_b15d_15524e289863 -->|calls| f620c002_62d4_28c9_f35a_46baa1bba84f
  a4d3f8ce_9340_6698_41c0_7bd0a817048e["processValueWhen()"]
  a4d3f8ce_9340_6698_41c0_7bd0a817048e -->|calls| f620c002_62d4_28c9_f35a_46baa1bba84f
  0d94726e_741b_9208_9d8c_ca4cd0f4cf12["of()"]
  f620c002_62d4_28c9_f35a_46baa1bba84f -->|calls| 0d94726e_741b_9208_9d8c_ca4cd0f4cf12
  style f620c002_62d4_28c9_f35a_46baa1bba84f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/json/JsonWriterTests.java lines 297–303

		@Test
		void when() {
			Predicate<@Nullable List<String>> isEmpty = List::isEmpty;
			JsonWriter<List<String>> writer = JsonWriter.of((members) -> members.add().when(isEmpty));
			assertThat(writer.writeToString(List.of("a"))).isEmpty();
			assertThat(writer.writeToString(Collections.emptyList())).isEqualTo("[]");
		}

Domain

Subdomains

Calls

Frequently Asked Questions

What does when() do?
when() is a function in the spring-boot codebase.
What does when() call?
when() calls 1 function(s): of.
What calls when()?
when() is called by 4 function(s): chainedAsAndPredicates, processValueWhen, whenWhenPredicateDoesNotMatch, whenWhenPredicateMatches.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free