@@ -47,7 +47,7 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper
|
||||
*/
|
||||
public ConfigurableTypeInformationMapper(Map<? extends Class<?>, String> sourceTypeMap) {
|
||||
|
||||
Assert.notNull(sourceTypeMap, "SourceTypeMap must not be null!");
|
||||
Assert.notNull(sourceTypeMap, "SourceTypeMap must not be null");
|
||||
|
||||
this.typeToAlias = new HashMap<>(sourceTypeMap.size());
|
||||
this.aliasToType = new HashMap<>(sourceTypeMap.size());
|
||||
@@ -59,7 +59,7 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper
|
||||
|
||||
if (typeToAlias.containsValue(alias)) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Detected mapping ambiguity! String %s cannot be mapped to more than one type", alias));
|
||||
String.format("Detected mapping ambiguity; String %s cannot be mapped to more than one type", alias));
|
||||
}
|
||||
|
||||
this.typeToAlias.put(type, alias);
|
||||
|
||||
@@ -48,9 +48,9 @@ public interface ConverterBuilder {
|
||||
static <S, T> ReadingConverterBuilder<S, T> reading(Class<S> source, Class<T> target,
|
||||
Function<? super S, ? extends T> function) {
|
||||
|
||||
Assert.notNull(source, "Source type must not be null!");
|
||||
Assert.notNull(target, "Target type must not be null!");
|
||||
Assert.notNull(function, "Conversion function must not be null!");
|
||||
Assert.notNull(source, "Source type must not be null");
|
||||
Assert.notNull(target, "Target type must not be null");
|
||||
Assert.notNull(function, "Conversion function must not be null");
|
||||
|
||||
return new DefaultConverterBuilder<>(new ConvertiblePair(source, target), Optional.empty(), Optional.of(function));
|
||||
}
|
||||
@@ -67,9 +67,9 @@ public interface ConverterBuilder {
|
||||
static <S, T> WritingConverterBuilder<S, T> writing(Class<S> source, Class<T> target,
|
||||
Function<? super S, ? extends T> function) {
|
||||
|
||||
Assert.notNull(source, "Source type must not be null!");
|
||||
Assert.notNull(target, "Target type must not be null!");
|
||||
Assert.notNull(function, "Conversion function must not be null!");
|
||||
Assert.notNull(source, "Source type must not be null");
|
||||
Assert.notNull(target, "Target type must not be null");
|
||||
Assert.notNull(function, "Conversion function must not be null");
|
||||
|
||||
return new DefaultConverterBuilder<>(new ConvertiblePair(target, source), Optional.of(function), Optional.empty());
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ import org.springframework.util.ObjectUtils;
|
||||
public class CustomConversions {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(CustomConversions.class);
|
||||
private static final String READ_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as reading converter although it doesn't convert from a store-supported type; You might want to check your annotation setup at the converter implementation.";
|
||||
private static final String WRITE_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation.";
|
||||
private static final String READ_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as reading converter although it doesn't convert from a store-supported type; You might want to check your annotation setup at the converter implementation";
|
||||
private static final String WRITE_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation";
|
||||
private static final String NOT_A_CONVERTER = "Converter %s is neither a Spring Converter, GenericConverter or ConverterFactory";
|
||||
private static final String CONVERTER_FILTER = "converter from %s to %s as %s converter.";
|
||||
private static final String CONVERTER_FILTER = "converter from %s to %s as %s converter";
|
||||
private static final String ADD_CONVERTER = "Adding %s" + CONVERTER_FILTER;
|
||||
private static final String SKIP_CONVERTER = "Skipping " + CONVERTER_FILTER
|
||||
+ " %s is not a store supported simple type";
|
||||
|
||||
@@ -82,8 +82,8 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
@Nullable MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext,
|
||||
List<? extends TypeInformationMapper> additionalMappers) {
|
||||
|
||||
Assert.notNull(accessor, "Accessor must not be null!");
|
||||
Assert.notNull(additionalMappers, "AdditionalMappers must not be null!");
|
||||
Assert.notNull(accessor, "Accessor must not be null");
|
||||
Assert.notNull(additionalMappers, "AdditionalMappers must not be null");
|
||||
|
||||
List<TypeInformationMapper> mappers = new ArrayList<>(additionalMappers.size() + 1);
|
||||
if (mappingContext != null) {
|
||||
@@ -111,7 +111,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
@Override
|
||||
public TypeInformation<?> readType(S source) {
|
||||
|
||||
Assert.notNull(source, "Source object must not be null!");
|
||||
Assert.notNull(source, "Source object must not be null");
|
||||
|
||||
return getFromCacheOrCreate(accessor.readAliasFrom(source));
|
||||
}
|
||||
@@ -138,8 +138,8 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
@Override
|
||||
public <T> TypeInformation<? extends T> readType(S source, TypeInformation<T> basicType) {
|
||||
|
||||
Assert.notNull(source, "Source must not be null!");
|
||||
Assert.notNull(basicType, "Basic type must not be null!");
|
||||
Assert.notNull(source, "Source must not be null");
|
||||
Assert.notNull(basicType, "Basic type must not be null");
|
||||
|
||||
Class<?> documentsTargetType = getDefaultedTypeToBeUsed(source);
|
||||
|
||||
@@ -196,7 +196,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
@Override
|
||||
public void writeType(TypeInformation<?> info, S sink) {
|
||||
|
||||
Assert.notNull(info, "TypeInformation must not be null!");
|
||||
Assert.notNull(info, "TypeInformation must not be null");
|
||||
|
||||
Alias alias = getAliasFor(info);
|
||||
if (alias.isPresent()) {
|
||||
@@ -222,7 +222,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
*/
|
||||
protected final Alias getAliasFor(TypeInformation<?> info) {
|
||||
|
||||
Assert.notNull(info, "TypeInformation must not be null!");
|
||||
Assert.notNull(info, "TypeInformation must not be null");
|
||||
|
||||
for (TypeInformationMapper mapper : mappers) {
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ public class DtoInstantiatingConverter implements Converter<Object, Object> {
|
||||
MappingContext<? extends PersistentEntity<?, ?>, ? extends PersistentProperty<?>> context,
|
||||
EntityInstantiators instantiators) {
|
||||
|
||||
Assert.notNull(dtoType, "DTO type must not be null!");
|
||||
Assert.notNull(context, "MappingContext must not be null!");
|
||||
Assert.notNull(instantiators, "EntityInstantiators must not be null!");
|
||||
Assert.notNull(dtoType, "DTO type must not be null");
|
||||
Assert.notNull(context, "MappingContext must not be null");
|
||||
Assert.notNull(instantiators, "EntityInstantiators must not be null");
|
||||
|
||||
this.targetType = dtoType;
|
||||
this.context = context;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe
|
||||
*/
|
||||
public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) {
|
||||
|
||||
Assert.notNull(mappingContext, "MappingContext must not be null!");
|
||||
Assert.notNull(mappingContext, "MappingContext must not be null");
|
||||
|
||||
this.typeMap = new ConcurrentHashMap<>();
|
||||
this.mappingContext = mappingContext;
|
||||
|
||||
@@ -89,7 +89,7 @@ final class PropertyValueConverterFactories {
|
||||
public <S, T, C extends ValueConversionContext<?>> PropertyValueConverter<S, T, C> getConverter(
|
||||
Class<? extends PropertyValueConverter<S, T, C>> converterType) {
|
||||
|
||||
Assert.notNull(converterType, "ConverterType must not be null!");
|
||||
Assert.notNull(converterType, "ConverterType must not be null");
|
||||
|
||||
if (converterType.isEnum()) {
|
||||
return (PropertyValueConverter<S, T, C>) EnumSet.allOf((Class) converterType).iterator().next();
|
||||
|
||||
@@ -108,7 +108,7 @@ public class PropertyValueConverterRegistrar<P extends PersistentProperty<P>> {
|
||||
*/
|
||||
public void registerConvertersIn(@NonNull ValueConverterRegistry<P> target) {
|
||||
|
||||
Assert.notNull(target, "Target registry must not be null!");
|
||||
Assert.notNull(target, "Target registry must not be null");
|
||||
|
||||
registry.getConverterRegistrationMap().forEach((key, value) ->
|
||||
target.registerConverter(key.type, key.path, value));
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.util.Assert;
|
||||
public class SimplePropertyValueConversions implements PropertyValueConversions, InitializingBean {
|
||||
|
||||
private static final String NO_CONVERTER_FACTORY_ERROR_MESSAGE =
|
||||
"PropertyValueConverterFactory is not set. Make sure to either set the converter factory or call afterPropertiesSet() to initialize the object.";
|
||||
"PropertyValueConverterFactory is not set; Make sure to either set the converter factory or call afterPropertiesSet() to initialize the object";
|
||||
|
||||
private boolean converterCacheEnabled = true;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public interface ValueConversionContext<P extends PersistentProperty<P>> {
|
||||
}
|
||||
|
||||
throw new IllegalStateException(String.format(
|
||||
"%s does not provide write function that allows value conversion to target type (%s).", getClass(), target));
|
||||
"%s does not provide write function that allows value conversion to target type (%s)", getClass(), target));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,6 +139,6 @@ public interface ValueConversionContext<P extends PersistentProperty<P>> {
|
||||
}
|
||||
|
||||
throw new IllegalStateException(String.format(
|
||||
"%s does not provide read function that allows value conversion to target type (%s).", getClass(), target));
|
||||
"%s does not provide read function that allows value conversion to target type (%s)", getClass(), target));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user