DATACMNS-985 - Remove references to single-argument assertion methods.
This commit is contained in:
committed by
Oliver Gierke
parent
49817278b7
commit
3e048a6dca
@@ -37,13 +37,13 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper
|
||||
private final Map<ClassTypeInformation<?>, Object> typeMap;
|
||||
|
||||
/**
|
||||
* Creates a new {@link ConfigurableTypeMapper} for the given type map.
|
||||
* Creates a new {@link ConfigurableTypeInformationMapper} for the given type map.
|
||||
*
|
||||
* @param sourceTypeMap must not be {@literal null}.
|
||||
*/
|
||||
public ConfigurableTypeInformationMapper(Map<? extends Class<?>, String> sourceTypeMap) {
|
||||
|
||||
Assert.notNull(sourceTypeMap);
|
||||
Assert.notNull(sourceTypeMap, "SourceTypeMap must not be null!");
|
||||
this.typeMap = new HashMap<ClassTypeInformation<?>, Object>(sourceTypeMap.size());
|
||||
|
||||
for (Entry<? extends Class<?>, String> entry : sourceTypeMap.entrySet()) {
|
||||
|
||||
@@ -77,8 +77,8 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
|
||||
MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext,
|
||||
List<? extends TypeInformationMapper> additionalMappers) {
|
||||
|
||||
Assert.notNull(accessor);
|
||||
Assert.notNull(additionalMappers);
|
||||
Assert.notNull(accessor, "Accessor must not be null!");
|
||||
Assert.notNull(additionalMappers, "AdditionalMappers must not be null!");
|
||||
|
||||
List<TypeInformationMapper> mappers = new ArrayList<TypeInformationMapper>(additionalMappers.size() + 1);
|
||||
if (mappingContext != null) {
|
||||
@@ -97,7 +97,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
|
||||
*/
|
||||
public TypeInformation<?> readType(S source) {
|
||||
|
||||
Assert.notNull(source);
|
||||
Assert.notNull(source, "Source object must not be null!");
|
||||
|
||||
Object alias = accessor.readAliasFrom(source);
|
||||
return alias == null ? null : getFromCacheOrCreate(alias);
|
||||
@@ -138,7 +138,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> TypeInformation<? extends T> readType(S source, TypeInformation<T> basicType) {
|
||||
|
||||
Assert.notNull(source);
|
||||
Assert.notNull(source, "Source object must not be null!");
|
||||
Class<?> documentsTargetType = getDefaultedTypeToBeUsed(source);
|
||||
|
||||
if (documentsTargetType == null) {
|
||||
@@ -198,7 +198,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
|
||||
*/
|
||||
public void writeType(TypeInformation<?> info, S sink) {
|
||||
|
||||
Assert.notNull(info);
|
||||
Assert.notNull(info, "TypeInformation must not be null!");
|
||||
|
||||
Object alias = getAliasFor(info);
|
||||
if (alias != null) {
|
||||
@@ -215,7 +215,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
|
||||
*/
|
||||
protected final Object getAliasFor(TypeInformation<?> info) {
|
||||
|
||||
Assert.notNull(info);
|
||||
Assert.notNull(info, "TypeInformation must not be null!");
|
||||
|
||||
for (TypeInformationMapper mapper : mappers) {
|
||||
Object alias = mapper.createAliasFor(info);
|
||||
|
||||
@@ -62,14 +62,14 @@ public class EntityInstantiators {
|
||||
* Creates a new {@link EntityInstantiator} using the given fallback {@link EntityInstantiator} and the given custom
|
||||
* ones.
|
||||
*
|
||||
* @param fallback must not be {@literal null}.
|
||||
* @param defaultInstantiator must not be {@literal null}.
|
||||
* @param customInstantiators must not be {@literal null}.
|
||||
*/
|
||||
public EntityInstantiators(EntityInstantiator defaultInstantiator,
|
||||
Map<Class<?>, EntityInstantiator> customInstantiators) {
|
||||
|
||||
Assert.notNull(defaultInstantiator);
|
||||
Assert.notNull(customInstantiators);
|
||||
Assert.notNull(defaultInstantiator, "DefaultInstantiator must not be null!");
|
||||
Assert.notNull(customInstantiators, "CustomInstantiators must not be null!");
|
||||
|
||||
this.fallback = defaultInstantiator;
|
||||
this.customInstantiators = customInstantiators;
|
||||
@@ -83,7 +83,7 @@ public class EntityInstantiators {
|
||||
*/
|
||||
public EntityInstantiator getInstantiatorFor(PersistentEntity<?, ?> entity) {
|
||||
|
||||
Assert.notNull(entity);
|
||||
Assert.notNull(entity, "Entity must not be null!");
|
||||
Class<?> type = entity.getType();
|
||||
|
||||
if (!customInstantiators.containsKey(type)) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe
|
||||
*/
|
||||
public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) {
|
||||
|
||||
Assert.notNull(mappingContext);
|
||||
Assert.notNull(mappingContext, "MappingContext must not be null!");
|
||||
|
||||
this.typeMap = new ConcurrentHashMap<ClassTypeInformation<?>, CacheValue<Object>>();
|
||||
this.mappingContext = mappingContext;
|
||||
|
||||
Reference in New Issue
Block a user