Skip to content

Commit 413d9b2

Browse files
committed
Reverted formatting changes that are not related to the work at hand.
1 parent ffaa5a0 commit 413d9b2

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

bson/src/main/org/bson/codecs/DecoderContext.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
* @since 3.0
2424
*/
2525
public final class DecoderContext {
26-
27-
28-
private DecoderContext() {
29-
}
30-
3126
/**
3227
* Create a builder.
3328
*
@@ -41,17 +36,18 @@ public static Builder builder() {
4136
* A builder for {@code DecoderContext} instances.
4237
*/
4338
public static final class Builder {
44-
4539
private Builder() {
46-
4740
}
4841

4942
/**
5043
* Build an instance of {@code DecoderContext}.
5144
* @return the decoder context
5245
*/
5346
public DecoderContext build() {
54-
return new DecoderContext();
47+
return new DecoderContext(this);
5548
}
5649
}
50+
51+
private DecoderContext(final Builder builder) {
52+
}
5753
}

bson/src/main/org/bson/codecs/EncoderContext.java

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,6 @@ public final class EncoderContext {
3030

3131
private final boolean encodingCollectibleDocument;
3232

33-
/**
34-
* Returns true if the the value to be encoded is a document that will be
35-
* put in a MongoDB collection. Encoders for such documents
36-
* might choose to act differently when encoding such as documents,
37-
* e.g. by re-ordering the fields in some way (like encoding the _id
38-
* field first).
39-
*
40-
* @return true if the value to be encoded is a document that will be put in a MongoDB collection
41-
*/
42-
public boolean isEncodingCollectibleDocument() {
43-
return encodingCollectibleDocument;
44-
}
45-
4633
/**
4734
* Create a builder.
4835
*
@@ -62,11 +49,9 @@ private Builder() {
6249
}
6350

6451
/**
65-
* Set to true if the the value to be encoded is a
66-
* document that will be put in a MongoDB collection.
52+
* Set to true if the the value to be encoded is a document that will be put in a MongoDB collection.
6753
*
68-
* @param encodingCollectibleDocument true if the value to be encoded is a document
69-
* that will be put in a MongoDB collection
54+
* @param encodingCollectibleDocument true if the value to be encoded is a document that will be put in a MongoDB collection
7055
* @return this
7156
*/
7257
public Builder isEncodingCollectibleDocument(final boolean encodingCollectibleDocument) {
@@ -83,6 +68,17 @@ public EncoderContext build() {
8368
}
8469
}
8570

71+
/**
72+
* Returns true if the the value to be encoded is a document that will be put in a MongoDB collection. Encoders for such documents
73+
* might choose to act differently when encoding such as documents, e.g. by re-ordering the fields in some way (like encoding the _id
74+
* field first).
75+
*
76+
* @return true if the value to be encoded is a document that will be put in a MongoDB collection
77+
*/
78+
public boolean isEncodingCollectibleDocument() {
79+
return encodingCollectibleDocument;
80+
}
81+
8682
/**
8783
* Creates a child context based on this and serializes the value with it to the writer.
8884
*

0 commit comments

Comments
 (0)