public class PrefixingDelegatingAggregationOperationContext extends Object implements AggregationOperationContext
AggregationOperationContext implementation prefixing non-command keys on root level with the given prefix.
Useful when mapping fields to domain specific types while having to prefix keys for query purpose.
Fields to be excluded from prefixing my be added to a blacklist.| Constructor and Description |
|---|
PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate,
String prefix) |
PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate,
String prefix,
Collection<String> blacklist) |
| Modifier and Type | Method and Description |
|---|---|
Fields |
getFields(Class<?> type)
Returns the
Fields exposed by the type. |
org.bson.Document |
getMappedObject(org.bson.Document document)
Returns the mapped
Document, potentially converting the source considering mapping metadata etc. |
org.bson.Document |
getMappedObject(org.bson.Document document,
Class<?> type)
Returns the mapped
Document, potentially converting the source considering mapping metadata for the given
type. |
ExposedFields.FieldReference |
getReference(Field field)
Returns a
ExposedFields.FieldReference for the given field or null if the context does not expose the given
field. |
ExposedFields.FieldReference |
getReference(String name)
Returns the
ExposedFields.FieldReference for the field with the given name or null if the context does not
expose a field with the given name. |
public PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate, String prefix)
public PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate, String prefix, Collection<String> blacklist)
public org.bson.Document getMappedObject(org.bson.Document document)
AggregationOperationContextDocument, potentially converting the source considering mapping metadata etc.getMappedObject in interface AggregationOperationContextdocument - will never be null.public org.bson.Document getMappedObject(org.bson.Document document,
@Nullable
Class<?> type)
AggregationOperationContextDocument, potentially converting the source considering mapping metadata for the given
type.getMappedObject in interface AggregationOperationContextdocument - will never be null.type - can be null.public ExposedFields.FieldReference getReference(Field field)
AggregationOperationContextExposedFields.FieldReference for the given field or null if the context does not expose the given
field.getReference in interface AggregationOperationContextfield - must not be null.public ExposedFields.FieldReference getReference(String name)
AggregationOperationContextExposedFields.FieldReference for the field with the given name or null if the context does not
expose a field with the given name.getReference in interface AggregationOperationContextname - must not be null or empty.public Fields getFields(Class<?> type)
AggregationOperationContextFields exposed by the type. May be a class or an interface. The default
implementation uses property descriptors discover fields from a
Class.getFields in interface AggregationOperationContexttype - must not be null.BeanUtils.getPropertyDescriptor(Class, String)Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.