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

chainedAsAndPredicates() — spring-boot Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8ea4c37c_1dd2_79b7_c690_a4fbac2e56d7["chainedAsAndPredicates()"]
  0d94726e_741b_9208_9d8c_ca4cd0f4cf12["of()"]
  8ea4c37c_1dd2_79b7_c690_a4fbac2e56d7 -->|calls| 0d94726e_741b_9208_9d8c_ca4cd0f4cf12
  53529e0a_765f_c768_6c97_b6a34a94ab86["whenNot()"]
  8ea4c37c_1dd2_79b7_c690_a4fbac2e56d7 -->|calls| 53529e0a_765f_c768_6c97_b6a34a94ab86
  f620c002_62d4_28c9_f35a_46baa1bba84f["when()"]
  8ea4c37c_1dd2_79b7_c690_a4fbac2e56d7 -->|calls| f620c002_62d4_28c9_f35a_46baa1bba84f
  style 8ea4c37c_1dd2_79b7_c690_a4fbac2e56d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/json/JsonWriterTests.java lines 341–354

		@Test
		void chainedAsAndPredicates() {
			Extractor<Integer, Boolean> booleanExtractor = (integer) -> integer != 0;
			Predicate<@Nullable String> isEmpty = (string) -> !StringUtils.hasLength(string);
			JsonWriter<String> writer = JsonWriter.of((members) -> members.add()
				.whenNot(isEmpty)
				.as(Integer::valueOf)
				.when((integer) -> integer < 2)
				.as(booleanExtractor));
			assertThat(writer.writeToString("")).isEmpty();
			assertThat(writer.writeToString("0")).isEqualTo("false");
			assertThat(writer.writeToString("1")).isEqualTo("true");
			assertThat(writer.writeToString("2")).isEmpty();
		}

Domain

Subdomains

Frequently Asked Questions

What does chainedAsAndPredicates() do?
chainedAsAndPredicates() is a function in the spring-boot codebase.
What does chainedAsAndPredicates() call?
chainedAsAndPredicates() calls 3 function(s): of, when, whenNot.

Analyze Your Own Codebase

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

Try Supermodel Free