1 package org.onap.so.apihandlerinfra;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
7 import org.springframework.core.convert.TypeDescriptor;
8 import org.springframework.core.convert.converter.GenericConverter;
9 import org.springframework.stereotype.Component;
10 import com.google.common.collect.ImmutableSet;
13 @ConfigurationPropertiesBinding
14 public class GenericStringConverter implements GenericConverter {
17 private HealthCheckConverter converter;
20 public Set<ConvertiblePair> getConvertibleTypes() {
22 ConvertiblePair[] pairs = new ConvertiblePair[] {new ConvertiblePair(String.class, Subsystem.class),
23 new ConvertiblePair(String.class, URI.class)};
24 return ImmutableSet.copyOf(pairs);
28 public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
30 return converter.convert(source, sourceType, targetType);