Home / Class/ NumberToPeriodConverter Class — spring-boot Architecture

NumberToPeriodConverter Class — spring-boot Architecture

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

Entity Profile

Source Code

core/spring-boot/src/main/java/org/springframework/boot/convert/NumberToPeriodConverter.java lines 38–53

final class NumberToPeriodConverter implements GenericConverter {

	private final StringToPeriodConverter delegate = new StringToPeriodConverter();

	@Override
	public Set<ConvertiblePair> getConvertibleTypes() {
		return Collections.singleton(new ConvertiblePair(Number.class, Period.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