change package to com.baeldung

This commit is contained in:
DOHA
2019-07-07 13:46:24 +03:00
parent 8d11845d5b
commit 1888a2f7e8
6 changed files with 23 additions and 8 deletions

View File

@@ -0,0 +1,16 @@
package com.baeldung.properties.conversion;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
@Component
@ConfigurationPropertiesBinding
public class EmployeeConverter implements Converter<String, Employee> {
@Override
public Employee convert(String from) {
String[] data = from.split(",");
return new Employee(data[0], Double.parseDouble(data[1]));
}
}