@@ -33,6 +33,7 @@ import org.springframework.util.Assert;
|
||||
* inspecting the {@link PersistentEntity} instances for type alias information.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
public class ConfigurableTypeInformationMapper implements TypeInformationMapper {
|
||||
|
||||
@@ -58,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);
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.springframework.util.ObjectUtils;
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @author Xeno Amess
|
||||
* @author Johannes Englmeier
|
||||
* @since 2.0
|
||||
*/
|
||||
public class CustomConversions {
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
* @author Johannes Englmeier
|
||||
* @since 2.0
|
||||
* @see ConverterBuilder#writing(Class, Class, Function)
|
||||
* @see ConverterBuilder#reading(Class, Class, Function)
|
||||
@@ -61,13 +62,13 @@ record DefaultConverterBuilder<S, T> (ConvertiblePair convertiblePair,
|
||||
@Override
|
||||
public GenericConverter getReadingConverter() {
|
||||
return getOptionalReadingConverter()
|
||||
.orElseThrow(() -> new IllegalStateException("No reading converter specified!"));
|
||||
.orElseThrow(() -> new IllegalStateException("No reading converter specified"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericConverter getWritingConverter() {
|
||||
return getOptionalWritingConverter()
|
||||
.orElseThrow(() -> new IllegalStateException("No writing converter specified!"));
|
||||
.orElseThrow(() -> new IllegalStateException("No writing converter specified"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Christoph Strobl
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
public class MappingContextTypeInformationMapper implements TypeInformationMapper {
|
||||
|
||||
@@ -87,7 +88,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe
|
||||
if (existingAlias.isPresentButDifferent(alias)) {
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s!", alias,
|
||||
String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s", alias,
|
||||
existingAlias, key));
|
||||
}
|
||||
|
||||
@@ -100,7 +101,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe
|
||||
.findFirst().ifPresent(it -> {
|
||||
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s!", key,
|
||||
"Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s", key,
|
||||
alias, it.getKey()));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user