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.
Constructor and Description |
---|
PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate,
String prefix) |
PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate,
String prefix,
Collection<String> denylist) |
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. |
ExposedFields.FieldReference |
getReference(String name)
Returns the
ExposedFields.FieldReference for the field with the given name. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnMissingFieldReference
public PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate, String prefix)
public PrefixingDelegatingAggregationOperationContext(AggregationOperationContext delegate, String prefix, Collection<String> denylist)
public org.bson.Document getMappedObject(org.bson.Document document)
AggregationOperationContext
Document
, potentially converting the source considering mapping metadata etc.getMappedObject
in interface AggregationOperationContext
document
- will never be null.public org.bson.Document getMappedObject(org.bson.Document document, @Nullable Class<?> type)
AggregationOperationContext
Document
, potentially converting the source considering mapping metadata for the given
type.getMappedObject
in interface AggregationOperationContext
document
- will never be null.type
- can be null.public ExposedFields.FieldReference getReference(Field field)
AggregationOperationContext
ExposedFields.FieldReference
for the given field.getReference
in interface AggregationOperationContext
field
- must not be null.ExposedFields.FieldReference
for the given Field
.public ExposedFields.FieldReference getReference(String name)
AggregationOperationContext
ExposedFields.FieldReference
for the field with the given name.getReference
in interface AggregationOperationContext
name
- must not be null or empty.ExposedFields.FieldReference
for the field with given name.public Fields getFields(Class<?> type)
AggregationOperationContext
Fields
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 AggregationOperationContext
type
- must not be null.BeanUtils.getPropertyDescriptor(Class, String)
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.