Module spring.data.mongodb
Class TestAggregationContext
java.lang.Object
org.springframework.data.mongodb.util.aggregation.TestAggregationContext
- All Implemented Interfaces:
CodecRegistryProvider,AggregationOperationContext
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionstatic AggregationOperationContextcontextFor(Class<?> type) static AggregationOperationContextcontextFor(Class<?> type, MongoConverter mongoConverter) org.bson.codecs.configuration.CodecRegistryGet the underlyingCodecRegistryused by the MongoDB Java driver.org.bson.DocumentgetMappedObject(org.bson.Document document, Class<?> type) Returns the mappedDocument, potentially converting the source considering mapping metadata for the given type.getReference(String name) Returns theExposedFields.FieldReferencefor the field with the given name.getReference(Field field) Returns aExposedFields.FieldReferencefor the given field.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.mongodb.core.aggregation.AggregationOperationContext
continueOnMissingFieldReference, expose, getFields, getMappedObject, inheritAndExposeMethods inherited from interface org.springframework.data.mongodb.CodecRegistryProvider
getCodecFor, hasCodecFor
-
Method Details
-
contextFor
-
contextFor
public static AggregationOperationContext contextFor(@Nullable Class<?> type, MongoConverter mongoConverter) -
getMappedObject
Description copied from interface:AggregationOperationContextReturns the mappedDocument, potentially converting the source considering mapping metadata for the given type.- Specified by:
getMappedObjectin interfaceAggregationOperationContext- Parameters:
document- will never be null.type- can be null.- Returns:
- must not be null.
-
getReference
Description copied from interface:AggregationOperationContextReturns aExposedFields.FieldReferencefor the given field.- Specified by:
getReferencein interfaceAggregationOperationContext- Parameters:
field- must not be null.- Returns:
- the
ExposedFields.FieldReferencefor the givenField.
-
getReference
Description copied from interface:AggregationOperationContextReturns theExposedFields.FieldReferencefor the field with the given name.- Specified by:
getReferencein interfaceAggregationOperationContext- Parameters:
name- must not be null or empty.- Returns:
- the
ExposedFields.FieldReferencefor the field with given name.
-
getCodecRegistry
public org.bson.codecs.configuration.CodecRegistry getCodecRegistry()Description copied from interface:CodecRegistryProviderGet the underlyingCodecRegistryused by the MongoDB Java driver.- Specified by:
getCodecRegistryin interfaceAggregationOperationContext- Specified by:
getCodecRegistryin interfaceCodecRegistryProvider- Returns:
- never null.
-