java.lang.Object
org.springframework.data.mongodb.core.aggregation.ExposedFields
All Implemented Interfaces:
Iterable<org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField>

public final class ExposedFields extends Object implements Iterable<org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField>
Value object to capture the fields exposed by an AggregationOperation.
Since:
1.3
Author:
Oliver Gierke, Thomas Darimont, Mark Paluch
  • Method Details

    • empty

      public static ExposedFields empty()
      Returns an empty ExposedFields instance.
      Returns:
      never null.
      Since:
      2.0
    • from

      public static ExposedFields from(org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField... fields)
      Creates a new ExposedFields instance from the given ExposedFields.ExposedFields.
      Parameters:
      fields - must not be null.
      Returns:
      never null.
    • synthetic

      public static ExposedFields synthetic(Fields fields)
      Creates synthetic ExposedFields from the given Fields.
      Parameters:
      fields - must not be null.
      Returns:
      never null.
    • nonSynthetic

      public static ExposedFields nonSynthetic(Fields fields)
      Creates non-synthetic ExposedFields from the given Fields.
      Parameters:
      fields - must not be null.
      Returns:
      never null.
    • and

      public ExposedFields and(org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField field)
      Creates a new ExposedFields adding the given ExposedFields.ExposedField.
      Parameters:
      field - must not be null.
      Returns:
      new instance of ExposedFields.
    • getField

      @Nullable public org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField getField(String name)
      Returns the field with the given name or null if no field with the given name is available.
      Parameters:
      name - must not be null.
      Returns:
      can be null.
    • iterator

      public Iterator<org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField> iterator()
      Specified by:
      iterator in interface Iterable<org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField>