chainedPredicates() — spring-boot Function Reference
Architecture documentation for the chainedPredicates() function in JsonWriterTests.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD 9cba374a_97d6_20b8_3910_1b5dca383960["chainedPredicates()"] 0d94726e_741b_9208_9d8c_ca4cd0f4cf12["of()"] 9cba374a_97d6_20b8_3910_1b5dca383960 -->|calls| 0d94726e_741b_9208_9d8c_ca4cd0f4cf12 fd52a434_11b9_fcb8_5647_91e6fcf53672["whenHasLength()"] 9cba374a_97d6_20b8_3910_1b5dca383960 -->|calls| fd52a434_11b9_fcb8_5647_91e6fcf53672 53529e0a_765f_c768_6c97_b6a34a94ab86["whenNot()"] 9cba374a_97d6_20b8_3910_1b5dca383960 -->|calls| 53529e0a_765f_c768_6c97_b6a34a94ab86 d61ef6a0_daf3_14b5_0e3c_0e18dc46fd10["quoted()"] 9cba374a_97d6_20b8_3910_1b5dca383960 -->|calls| d61ef6a0_daf3_14b5_0e3c_0e18dc46fd10 style 9cba374a_97d6_20b8_3910_1b5dca383960 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
core/spring-boot/src/test/java/org/springframework/boot/json/JsonWriterTests.java lines 305–316
@Test
void chainedPredicates() {
Set<String> banned = Set.of("Spring", "Boot");
Predicate<@Nullable String> stringLengthPredicate = (string) -> string != null && string.length() <= 2;
Predicate<@Nullable String> bannedPredicate = (string) -> string != null && banned.contains(string);
JsonWriter<String> writer = JsonWriter
.of((members) -> members.add().whenHasLength().whenNot(bannedPredicate).whenNot(stringLengthPredicate));
assertThat(writer.writeToString("")).isEmpty();
assertThat(writer.writeToString("a")).isEmpty();
assertThat(writer.writeToString("Boot")).isEmpty();
assertThat(writer.writeToString("JSON")).isEqualTo(quoted("JSON"));
}
Domain
Subdomains
Source
Frequently Asked Questions
What does chainedPredicates() do?
chainedPredicates() is a function in the spring-boot codebase.
What does chainedPredicates() call?
chainedPredicates() calls 4 function(s): of, quoted, whenHasLength, whenNot.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free