From c9da0a75ffecc43404b19bb3be9e43d1a18dad23 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 20 Mar 2020 14:39:58 +0100 Subject: [PATCH] DATAMONGO-931 - Polishing. Reformat code. Add private constructor to prevent unwanted instantiation. Original pull request: #844. --- .../mongodb/core/aggregation/RedactOperation.java | 12 ++++++++---- .../core/aggregation/RedactOperationUnitTests.java | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java index 0ef9914b1..2bc77d358 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java @@ -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. - * + * *
  * 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.
 		 */
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/RedactOperationUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/RedactOperationUnitTests.java
index 93b422468..1e9946973 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/RedactOperationUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/RedactOperationUnitTests.java
@@ -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 {