Class TestAggregationContext
java.lang.Object
org.springframework.data.mongodb.util.aggregation.TestAggregationContext
- All Implemented Interfaces:
AggregationOperationContext
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionstatic AggregationOperationContext
contextFor
(Class<?> type) static AggregationOperationContext
contextFor
(Class<?> type, MongoConverter mongoConverter) org.bson.Document
getMappedObject
(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.FieldReference
for the field with the given name.getReference
(Field field) Returns aExposedFields.FieldReference
for the given field.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.mongodb.core.aggregation.AggregationOperationContext
continueOnMissingFieldReference, getFields, getMappedObject
-
Method Details
-
contextFor
-
contextFor
public static AggregationOperationContext contextFor(@Nullable Class<?> type, MongoConverter mongoConverter) -
getMappedObject
Description copied from interface:AggregationOperationContext
Returns the mappedDocument
, potentially converting the source considering mapping metadata for the given type.- Specified by:
getMappedObject
in interfaceAggregationOperationContext
- Parameters:
document
- will never be null.type
- can be null.- Returns:
- must not be null.
-
getReference
Description copied from interface:AggregationOperationContext
Returns aExposedFields.FieldReference
for the given field.- Specified by:
getReference
in interfaceAggregationOperationContext
- Parameters:
field
- must not be null.- Returns:
- the
ExposedFields.FieldReference
for the givenField
.
-
getReference
Description copied from interface:AggregationOperationContext
Returns theExposedFields.FieldReference
for the field with the given name.- Specified by:
getReference
in interfaceAggregationOperationContext
- Parameters:
name
- must not be null or empty.- Returns:
- the
ExposedFields.FieldReference
for the field with given name.
-