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

of() — spring-boot Function Reference

Architecture documentation for the of() function in RandomValuePropertySource.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  67ede5a4_13c2_6c3a_279d_560ec9d9336f["of()"]
  383d22e1_d782_5263_db71_52cac58d329d["getRandomValue()"]
  383d22e1_d782_5263_db71_52cac58d329d -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  1a224203_87a1_c88d_3820_f6185d35fd6a["getRandomBytes()"]
  1a224203_87a1_c88d_3820_f6185d35fd6a -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  c011891c_05f6_31b2_9021_5cca7470c65b["getValueShouldUseDirectMapping()"]
  c011891c_05f6_31b2_9021_5cca7470c65b -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  61f4ee14_965f_0311_409e_3afb3de2afcb["getValueOriginAndPropertySource()"]
  61f4ee14_965f_0311_409e_3afb3de2afcb -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  046046f9_9fd7_0539_990c_4886444ec698["getValueWhenOriginCapableShouldIncludeSourceOrigin()"]
  046046f9_9fd7_0539_990c_4886444ec698 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  1d4e6c9f_caca_a6b2_3ef7_c40736608676["containsDescendantOfShouldReturnEmpty()"]
  1d4e6c9f_caca_a6b2_3ef7_c40736608676 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  b794e928_d6fb_40b9_f984_d898c5938b86["containsDescendantOfWhenRandomSourceAndRandomPropertyReturnsPresent()"]
  b794e928_d6fb_40b9_f984_d898c5938b86 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  2ac19ca0_7d16_f51a_53e0_b55fd86e25fc["containsDescendantOfWhenRandomSourceAndRandomPrefixedPropertyReturnsPresent()"]
  2ac19ca0_7d16_f51a_53e0_b55fd86e25fc -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  36b56780_357c_d967_3ff0_40e4e9804739["containsDescendantOfWhenRandomSourceWithDifferentNameAndRandomPrefixedPropertyReturnsPresent()"]
  36b56780_357c_d967_3ff0_40e4e9804739 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  a01b4abc_c217_3c48_b2af_d2b944cab1f6["containsDescendantOfWhenRandomSourceAndNonRandomPropertyReturnsAbsent()"]
  a01b4abc_c217_3c48_b2af_d2b944cab1f6 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  6f3119b6_ef8f_3d0d_1c43_3f388104610a["containsDescendantOfWhenWrappedRandomSourceAndRandomPropertyReturnsPresent()"]
  6f3119b6_ef8f_3d0d_1c43_3f388104610a -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  3b6971c9_b509_6e5d_a0c5_25c0759a6603["containsDescendantOfWhenWrappedRandomSourceAndRandomPrefixedPropertyReturnsPresent()"]
  3b6971c9_b509_6e5d_a0c5_25c0759a6603 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  968a9e54_f04a_cf1e_5f6e_aa0397cca556["containsDescendantOfWhenWrappedRandomSourceWithMatchingNameAndRandomPrefixedPropertyReturnsPresent()"]
  968a9e54_f04a_cf1e_5f6e_aa0397cca556 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  98aa686f_e86e_9fe8_67a1_ab26b965d3e7["containsDescendantOfWhenWrappedRandomSourceAndRandomDashPrefixedPropertyReturnsPresent()"]
  98aa686f_e86e_9fe8_67a1_ab26b965d3e7 -->|calls| 67ede5a4_13c2_6c3a_279d_560ec9d9336f
  style 67ede5a4_13c2_6c3a_279d_560ec9d9336f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/env/RandomValuePropertySource.java lines 205–216

		static <T extends Number & Comparable<T>> Range<T> of(String value, Function<String, T> parse) {
			T zero = parse.apply("0");
			String[] tokens = StringUtils.commaDelimitedListToStringArray(value);
			T min = parse.apply(tokens[0]);
			if (tokens.length == 1) {
				Assert.state(min.compareTo(zero) > 0, "Bound must be positive.");
				return new Range<>(value, zero, min);
			}
			T max = parse.apply(tokens[1]);
			Assert.state(min.compareTo(max) < 0, "Lower bound must be less than upper bound.");
			return new Range<>(value, min, max);
		}

Domain

Subdomains

Called By

  • containsDescendantOfShouldReturnEmpty()
  • containsDescendantOfWhenRandomSourceAndNonRandomPropertyReturnsAbsent()
  • containsDescendantOfWhenRandomSourceAndRandomPrefixedPropertyReturnsPresent()
  • containsDescendantOfWhenRandomSourceAndRandomPropertyReturnsPresent()
  • containsDescendantOfWhenRandomSourceWithDifferentNameAndRandomPrefixedPropertyReturnsPresent()
  • containsDescendantOfWhenWrappedRandomSourceAndNonRandomPropertyReturnsAbsent()
  • containsDescendantOfWhenWrappedRandomSourceAndRandomDashPrefixedPropertyReturnsPresent()
  • containsDescendantOfWhenWrappedRandomSourceAndRandomPrefixedPropertyReturnsPresent()
  • containsDescendantOfWhenWrappedRandomSourceAndRandomPropertyReturnsPresent()
  • containsDescendantOfWhenWrappedRandomSourceWithMatchingNameAndRandomPrefixedPropertyReturnsPresent()
  • getRandomBytes()
  • getRandomValue()
  • getValueOriginAndPropertySource()
  • getValueShouldUseDirectMapping()
  • getValueWhenOriginCapableShouldIncludeSourceOrigin()
  • shouldAdaptMultiplePropertySources()
  • shouldAdaptPropertySource()
  • shouldAdaptRandomPropertySource()
  • shouldAdaptSystemEnvironmentPropertySource()
  • shouldAdaptSystemEnvironmentPropertySourceWithUnderscoreValue()
  • shouldExtendedAdaptSystemEnvironmentPropertySource()
  • shouldNotAdaptSystemEnvironmentPropertyOverrideSource()
  • shouldTrackWhenSourceHasIdenticalName()

Frequently Asked Questions

What does of() do?
of() is a function in the spring-boot codebase.
What calls of()?
of() is called by 23 function(s): containsDescendantOfShouldReturnEmpty, containsDescendantOfWhenRandomSourceAndNonRandomPropertyReturnsAbsent, containsDescendantOfWhenRandomSourceAndRandomPrefixedPropertyReturnsPresent, containsDescendantOfWhenRandomSourceAndRandomPropertyReturnsPresent, containsDescendantOfWhenRandomSourceWithDifferentNameAndRandomPrefixedPropertyReturnsPresent, containsDescendantOfWhenWrappedRandomSourceAndNonRandomPropertyReturnsAbsent, containsDescendantOfWhenWrappedRandomSourceAndRandomDashPrefixedPropertyReturnsPresent, containsDescendantOfWhenWrappedRandomSourceAndRandomPrefixedPropertyReturnsPresent, and 15 more.

Analyze Your Own Codebase

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

Try Supermodel Free