Home / Class/ NumberToDurationConverter Class — spring-boot Architecture

NumberToDurationConverter Class — spring-boot Architecture

Architecture documentation for the NumberToDurationConverter class in NumberToDurationConverter.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot/src/main/java/org/springframework/boot/convert/NumberToDurationConverter.java lines 37–52

final class NumberToDurationConverter implements GenericConverter {

	private final StringToDurationConverter delegate = new StringToDurationConverter();

	@Override
	public Set<ConvertiblePair> getConvertibleTypes() {
		return Collections.singleton(new ConvertiblePair(Number.class, Duration.class));
	}

	@Override
	public @Nullable Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
		return this.delegate.convert((source != null) ? source.toString() : null, TypeDescriptor.valueOf(String.class),
				targetType);
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free