@Bean
public KeyGenerator customKeyGenerator() {
return new KeyGenerator() {
@Override
public Object generate(Object o, Method method, Object... objects) {
StringBuilder sb = new StringBuilder();
sb.append(o.getClass().getName());
sb.append(method.getName());
for (Object obj : objects) {
sb.append(obj.toString());
}
return sb.toString();
}
};
}
@SuppressWarnings("unchecked")
private void properties(DataSourceBuilder builder, Map properties) {
if (CollectionUtils.isEmpty(properties)) {
return;
}
Field field = ReflectionUtils.findField(builder.getClass(), "properties");
if (field !
new String(org.springframework.security.crypto.codec.Hex.encode(password.getBytes(charset))
throw new IllegalStateException("Not supported database: " + database);
public enum AES {
V1(128), V2(256);
private int value;
private AES(int value) {
this.value = value;
}
public int getValue() {
return this.value;
}
}
new org.springframework.boot.bind.RelaxedDataBinder(dataSource).bind(new org.springframework.beans.MutablePropertyValues(this.properties.getProperties()));
new org.springframework.boot.context.properties.bind.Binder(new org.springframework.boot.context.properties.source.MapConfigurationPropertySource(this.properties.getProperties())).bind(org.springframework.boot.context.properties.source.ConfigurationPropertyName.EMPTY, org.springframework.boot.context.properties.bind.Bindable.ofInstance(dataSource));
byte[].class, Object.class Object.class, byte[].class
@Bean
public ConversionServiceFactoryBean conversionService(ApplicationContext applicationContext) {
ConversionServiceFactoryBean conversionServiceFactoryBean = new ConversionServiceFactoryBean() {
@Override
protected GenericConversionService createConversionService() {
GenericConversionService genericConversionService = super.createConversionService();
genericConversionService.addConverter(Object.class, byte[].class, new SerializingConverter());
genericConversionService.addConverter(byte[].class, Object.class, new DeserializingConverter(applicationContext.getClassLoader()));
genericConversionService.addConverter(new StringToDateConverter());
return genericConversionService;
}
};
return conversionServiceFactoryBean;
}
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.