DATAMONGO-931 - Polishing.

Reformat code. Add private constructor to prevent unwanted instantiation.

Original pull request: #844.
This commit is contained in:
Mark Paluch
2020-03-20 14:39:58 +01:00
parent 581961e79a
commit c9da0a75ff
2 changed files with 10 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ import org.springframework.util.Assert;
/**
* {@link RedactOperation} allows to restrict the content of a {@link Document} based on information stored within
* itself.
*
*
* <pre class="code">
* RedactOperation.builder() //
* .when(Criteria.where("level").is(5)) //
@@ -89,7 +89,7 @@ public class RedactOperation implements AggregationOperation {
/**
* Builder to create new instance of {@link RedactOperation}.
*
*
* @author Christoph Strobl
*/
public static class RedactOperationBuilder {
@@ -98,9 +98,13 @@ public class RedactOperation implements AggregationOperation {
private Object then;
private Object otherwise;
private RedactOperationBuilder() {
}
/**
* Specify the evaluation condition.
*
*
* @param criteria must not be {@literal null}.
* @return this.
*/
@@ -204,7 +208,7 @@ public class RedactOperation implements AggregationOperation {
/**
* Define the outcome (anything that resolves to {@literal $$DESCEND}, {@literal $$PRUNE}, or {@literal $$KEEP})
* when the condition is not met.
*
*
* @param otherwise must not be {@literal null}.
* @return this.
*/

View File

@@ -32,6 +32,8 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.lang.Nullable;
/**
* Unit tests for {@link RedactOperation}.
*
* @author Christoph Strobl
*/
class RedactOperationUnitTests {