org.kiwiproject.spring.data.AggregateResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kiwi Show documentation
Show all versions of kiwi Show documentation
Kiwi is a utility library. We really like Google's Guava, and also use Apache Commons.
But if they don't have something we need, and we think it is useful, this is where we put it.
package org.kiwiproject.spring.data;
import com.google.common.annotations.Beta;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
import java.util.List;
/**
* A generic aggregate result containing a list of results, and a total count.
*
* @param the content type contained in this aggregate result
* @implNote Marked as beta because it is used by {@link PagingQuery#aggregatePage(Class, AggregationOperation...)}.
* Read the docs there for an explanation why that is beta.
*/
@Getter
@Setter
@Beta
public class AggregateResult {
private List results;
private long totalCount;
/**
* Factory to create {@link AggregateResult} instances of a given type.
*
* @param clazz the Class representing the result type
* @param the result type
* @return a new instance
*/
@SuppressWarnings("unused")
public static AggregateResult of(Class clazz) {
return new AggregateResult<>();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy