Skip to content

Commit 72b5234

Browse files
committed
Auto-format
1 parent 48aa0fd commit 72b5234

19 files changed

Lines changed: 126 additions & 115 deletions

src/main/java/org/lmdbjava/AbstractFlagSet.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
import java.util.function.Function;
2525
import java.util.function.Supplier;
2626

27-
/** Encapsulates an immutable set of flags and the associated bit mask for the flags in the set.
27+
/**
28+
* Encapsulates an immutable set of flags and the associated bit mask for the flags in the set.
29+
*
2830
* @param <T> The type of the flags in this set. Must extend {@link MaskedFlag} and {@link Enum<T>}.
29-
* */
31+
*/
3032
abstract class AbstractFlagSet<T extends Enum<T> & MaskedFlag> implements FlagSet<T> {
3133

3234
private final Set<T> flags;
@@ -268,6 +270,7 @@ public Builder<E, S> setFlags(final Collection<E> flags) {
268270

269271
/**
270272
* Replaces any flags already set in the builder with the passed flags.
273+
*
271274
* @param flags The flags to set in the builder.
272275
* @return this builder instance.
273276
*/

src/main/java/org/lmdbjava/ByteUnit.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public long toBytes(final long value) {
6262

6363
/**
6464
* Gets factor to apply when converting this unit into bytes.
65+
*
6566
* @return The factor to apply when converting this unit into bytes.
6667
*/
6768
public long getFactor() {

src/main/java/org/lmdbjava/CopyFlagSet.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
/** An immutable set of flags for use when performing a {@link Env#copy(Path, CopyFlagSet)}. */
2323
public interface CopyFlagSet extends FlagSet<CopyFlags> {
2424

25-
/**
26-
* An immutable empty {@link CopyFlagSet}.
27-
*/
25+
/** An immutable empty {@link CopyFlagSet}. */
2826
CopyFlagSet EMPTY = CopyFlagSetImpl.EMPTY;
2927

3028
/**
3129
* Gets the immutable empty {@link CopyFlagSet} instance.
30+
*
3231
* @return The immutable empty {@link CopyFlagSet} instance.
3332
*/
3433
static CopyFlagSet empty() {
@@ -37,6 +36,7 @@ static CopyFlagSet empty() {
3736

3837
/**
3938
* Creates an immutable {@link CopyFlagSet} containing copyFlag.
39+
*
4040
* @param copyFlag The flag to include in the {@link CopyFlagSet}
4141
* @return An immutable {@link CopyFlagSet} containing just copyFlag.
4242
*/
@@ -47,6 +47,7 @@ static CopyFlagSet of(final CopyFlags copyFlag) {
4747

4848
/**
4949
* Creates an immutable {@link CopyFlagSet} containing copyFlags.
50+
*
5051
* @param copyFlags The flags to include in the {@link CopyFlagSet}.
5152
* @return An immutable {@link CopyFlagSet} containing copyFlags.
5253
*/
@@ -56,6 +57,7 @@ static CopyFlagSet of(final CopyFlags... copyFlags) {
5657

5758
/**
5859
* Creates an immutable {@link CopyFlagSet} containing copyFlags.
60+
*
5961
* @param copyFlags The flags to include in the {@link CopyFlagSet}.
6062
* @return An immutable {@link CopyFlagSet} containing copyFlags.
6163
*/
@@ -65,6 +67,7 @@ static CopyFlagSet of(final Collection<CopyFlags> copyFlags) {
6567

6668
/**
6769
* Create a builder for building an {@link CopyFlagSet}.
70+
*
6871
* @return A builder instance for building an {@link CopyFlagSet}.
6972
*/
7073
static AbstractFlagSet.Builder<CopyFlags, CopyFlagSet> builder() {

src/main/java/org/lmdbjava/CopyFlagSetEmpty.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@
1616
package org.lmdbjava;
1717

1818
class CopyFlagSetEmpty extends AbstractFlagSet.AbstractEmptyFlagSet<CopyFlags>
19-
implements CopyFlagSet {
20-
}
19+
implements CopyFlagSet {}

src/main/java/org/lmdbjava/Dbi.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public byte[] getName() {
279279

280280
/**
281281
* Obtains the name of this database, using the {@link Env#DEFAULT_NAME_CHARSET} {@link Charset}.
282+
*
282283
* @return The name of this database, using the {@link Env#DEFAULT_NAME_CHARSET} {@link Charset}.
283284
*/
284285
public String getNameAsString() {
@@ -288,7 +289,8 @@ public String getNameAsString() {
288289
/**
289290
* Obtains the name of this database, using the supplied {@link Charset}.
290291
*
291-
* @param charset The {@link Charset} to use when converting the DB from a byte[] to a {@link String}.
292+
* @param charset The {@link Charset} to use when converting the DB from a byte[] to a {@link
293+
* String}.
292294
* @return The name of the database. If this is the unnamed database an empty string will be
293295
* returned.
294296
* @throws RuntimeException if the name can't be decoded.

src/main/java/org/lmdbjava/DbiBuilder.java

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,12 @@ private Stage2(final DbiBuilder<T> dbiBuilder) {
109109
* functionally identical.
110110
*
111111
* <p>This option may be slightly more performant than when using {@link
112-
* Stage2#withNativeComparator()} which calls down to LMDB for ALL comparison
113-
* operations.
112+
* Stage2#withNativeComparator()} which calls down to LMDB for ALL comparison operations.
114113
*
115114
* <p>If you do not intend to use {@link CursorIterable} then it doesn't matter whether you
116-
* choose {@link Stage2#withNativeComparator()}, {@link
117-
* Stage2#withDefaultComparator()} or {@link
118-
* Stage2#withIteratorComparator(ComparatorFactory)} as these comparators will never
119-
* be used.
115+
* choose {@link Stage2#withNativeComparator()}, {@link Stage2#withDefaultComparator()} or
116+
* {@link Stage2#withIteratorComparator(ComparatorFactory)} as these comparators will never be
117+
* used.
120118
*
121119
* @return The next builder stage.
122120
*/
@@ -131,15 +129,13 @@ public Stage3<T> withDefaultComparator() {
131129
* keys using the same comparator that is used for insertion order into the db.
132130
*
133131
* <p>This option may be slightly less performant than when using {@link
134-
* Stage2#withDefaultComparator()} as it needs to call down to LMDB to perform the
135-
* comparisons, however it guarantees that {@link CursorIterable} key comparison matches LMDB
136-
* key comparison.
132+
* Stage2#withDefaultComparator()} as it needs to call down to LMDB to perform the comparisons,
133+
* however it guarantees that {@link CursorIterable} key comparison matches LMDB key comparison.
137134
*
138135
* <p>If you do not intend to use {@link CursorIterable} then it doesn't matter whether you
139-
* choose {@link Stage2#withNativeComparator()}, {@link
140-
* Stage2#withDefaultComparator()} or {@link
141-
* Stage2#withIteratorComparator(ComparatorFactory)} as these comparators will never
142-
* be used.
136+
* choose {@link Stage2#withNativeComparator()}, {@link Stage2#withDefaultComparator()} or
137+
* {@link Stage2#withIteratorComparator(ComparatorFactory)} as these comparators will never be
138+
* used.
143139
*
144140
* @return The next builder stage.
145141
*/
@@ -167,8 +163,7 @@ public Stage3<T> withNativeComparator() {
167163
* the {@link Dbi}. It must not return null.
168164
* @return The next builder stage.
169165
*/
170-
public Stage3<T> withCallbackComparator(
171-
final ComparatorFactory<T> comparatorFactory) {
166+
public Stage3<T> withCallbackComparator(final ComparatorFactory<T> comparatorFactory) {
172167
this.comparatorFactory = Objects.requireNonNull(comparatorFactory);
173168
this.comparatorType = ComparatorType.CALLBACK;
174169
return new Stage3<>(this);
@@ -189,18 +184,16 @@ public Stage3<T> withCallbackComparator(
189184
* when using {@link CursorIterable}.
190185
*
191186
* <p>If you do not intend to use {@link CursorIterable} then it doesn't matter whether you
192-
* choose {@link Stage2#withNativeComparator()}, {@link
193-
* Stage2#withDefaultComparator()} or {@link
194-
* Stage2#withIteratorComparator(ComparatorFactory)} as these comparators will never
195-
* be used.
187+
* choose {@link Stage2#withNativeComparator()}, {@link Stage2#withDefaultComparator()} or
188+
* {@link Stage2#withIteratorComparator(ComparatorFactory)} as these comparators will never be
189+
* used.
196190
*
197191
* @param comparatorFactory The comparator to use with {@link CursorIterable}. {@link
198192
* ComparatorFactory#create(DbiFlagSet)} will be called once during the initialisation of
199193
* the {@link Dbi}. It must not return null.
200194
* @return The next builder stage.
201195
*/
202-
public Stage3<T> withIteratorComparator(
203-
final ComparatorFactory<T> comparatorFactory) {
196+
public Stage3<T> withIteratorComparator(final ComparatorFactory<T> comparatorFactory) {
204197
this.comparatorFactory = Objects.requireNonNull(comparatorFactory);
205198
this.comparatorType = ComparatorType.ITERATOR;
206199
return new Stage3<>(this);
@@ -227,8 +220,8 @@ private Stage3(Stage2<T> stage2) {
227220
* Apply all the dbi flags supplied in dbiFlags.
228221
*
229222
* <p>Clears all flags currently set by previous calls to {@link
230-
* Stage3#setDbiFlags(Collection)}, {@link Stage3#setDbiFlags(DbiFlags...)}
231-
* or {@link Stage3#addDbiFlag(DbiFlags)}.
223+
* Stage3#setDbiFlags(Collection)}, {@link Stage3#setDbiFlags(DbiFlags...)} or {@link
224+
* Stage3#addDbiFlag(DbiFlags)}.
232225
*
233226
* @param dbiFlags to open the database with. A null {@link Collection} will just clear all set
234227
* flags. Null items are ignored.
@@ -246,8 +239,8 @@ public Stage3<T> setDbiFlags(final Collection<DbiFlags> dbiFlags) {
246239
* Apply all the dbi flags supplied in dbiFlags.
247240
*
248241
* <p>Clears all flags currently set by previous calls to {@link
249-
* Stage3#setDbiFlags(Collection)}, {@link Stage3#setDbiFlags(DbiFlags...)}
250-
* or {@link Stage3#addDbiFlag(DbiFlags)}.
242+
* Stage3#setDbiFlags(Collection)}, {@link Stage3#setDbiFlags(DbiFlags...)} or {@link
243+
* Stage3#addDbiFlag(DbiFlags)}.
251244
*
252245
* @param dbiFlags to open the database with. A null array will just clear all set flags. Null
253246
* items are ignored.
@@ -265,8 +258,8 @@ public Stage3<T> setDbiFlags(final DbiFlags... dbiFlags) {
265258
* Apply all the dbi flags supplied in dbiFlags.
266259
*
267260
* <p>Clears all flags currently set by previous calls to {@link
268-
* Stage3#setDbiFlags(Collection)}, {@link Stage3#setDbiFlags(DbiFlags...)}
269-
* or {@link Stage3#addDbiFlag(DbiFlags)}.
261+
* Stage3#setDbiFlags(Collection)}, {@link Stage3#setDbiFlags(DbiFlags...)} or {@link
262+
* Stage3#addDbiFlag(DbiFlags)}.
270263
*
271264
* @param dbiFlagSet to open the database with. A null value will just clear all set flags.
272265
* @return This builder instance.
@@ -281,8 +274,8 @@ public Stage3<T> setDbiFlags(final DbiFlagSet dbiFlagSet) {
281274

282275
/**
283276
* Adds a dbiFlag to those flags already added to this builder by {@link
284-
* Stage3#setDbiFlags(DbiFlags...)}, {@link Stage3#setDbiFlags(Collection)}
285-
* or {@link Stage3#addDbiFlag(DbiFlags)}.
277+
* Stage3#setDbiFlags(DbiFlags...)}, {@link Stage3#setDbiFlags(Collection)} or {@link
278+
* Stage3#addDbiFlag(DbiFlags)}.
286279
*
287280
* @param dbiFlag to add to any existing flags. A null value is a no-op.
288281
* @return this builder instance.
@@ -294,8 +287,8 @@ public Stage3<T> addDbiFlag(final DbiFlags dbiFlag) {
294287

295288
/**
296289
* Adds a dbiFlag to those flags already added to this builder by {@link
297-
* Stage3#setDbiFlags(DbiFlags...)}, {@link Stage3#setDbiFlags(Collection)}
298-
* or {@link Stage3#addDbiFlag(DbiFlags)}.
290+
* Stage3#setDbiFlags(DbiFlags...)}, {@link Stage3#setDbiFlags(Collection)} or {@link
291+
* Stage3#addDbiFlag(DbiFlags)}.
299292
*
300293
* @param dbiFlagSet to add to any existing flags. A null value is a no-op.
301294
* @return this builder instance.
@@ -310,8 +303,8 @@ public Stage3<T> addDbiFlags(final DbiFlagSet dbiFlagSet) {
310303
/**
311304
* Use the supplied transaction to open the {@link Dbi}.
312305
*
313-
* <p>The caller MUST commit the transaction after calling {@link Stage3#open()}, in
314-
* order to retain the <code>Dbi</code> in the <code>Env</code>.
306+
* <p>The caller MUST commit the transaction after calling {@link Stage3#open()}, in order to
307+
* retain the <code>Dbi</code> in the <code>Env</code>.
315308
*
316309
* <p>If you don't call this method to supply a {@link Txn}, a {@link Txn} will be opened for
317310
* the purpose of creating and opening the {@link Dbi}, then closed. Therefore, if you already
@@ -413,6 +406,7 @@ private enum ComparatorType {
413406

414407
/**
415408
* A factory for creating a {@link Comparator} from a {@link DbiFlagSet}
409+
*
416410
* @param <T> The type of buffer that will be compared by the created {@link Comparator}.
417411
*/
418412
@FunctionalInterface
@@ -422,8 +416,8 @@ public interface ComparatorFactory<T> {
422416
* Creates a comparator for the supplied {@link DbiFlagSet}. This will only be called once
423417
* during the initialisation of the {@link Dbi}.
424418
*
425-
* @param dbiFlagSet The flags set on the DB that the returned {@link Comparator} will be used by.
426-
* The flags in the set may impact how the returned {@link Comparator} should behave.
419+
* @param dbiFlagSet The flags set on the DB that the returned {@link Comparator} will be used
420+
* by. The flags in the set may impact how the returned {@link Comparator} should behave.
427421
* @return A {@link Comparator} applicable to the passed DB flags.
428422
*/
429423
Comparator<T> create(final DbiFlagSet dbiFlagSet);

src/main/java/org/lmdbjava/DbiFlagSet.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public interface DbiFlagSet extends FlagSet<DbiFlags> {
2929

3030
/**
3131
* Gets the immutable empty {@link DbiFlagSet} instance.
32+
*
3233
* @return The immutable empty {@link DbiFlagSet} instance.
3334
*/
3435
static DbiFlagSet empty() {
@@ -37,6 +38,7 @@ static DbiFlagSet empty() {
3738

3839
/**
3940
* Creates an immutable {@link DbiFlagSet} containing dbiFlag.
41+
*
4042
* @param dbiFlag The flag to include in the {@link DbiFlagSet}
4143
* @return An immutable {@link DbiFlagSet} containing just dbiFlag.
4244
*/
@@ -47,6 +49,7 @@ static DbiFlagSet of(final DbiFlags dbiFlag) {
4749

4850
/**
4951
* Creates an immutable {@link DbiFlagSet} containing dbiFlags.
52+
*
5053
* @param dbiFlags The flags to include in the {@link DbiFlagSet}.
5154
* @return An immutable {@link DbiFlagSet} containing dbiFlags.
5255
*/
@@ -56,6 +59,7 @@ static DbiFlagSet of(final DbiFlags... dbiFlags) {
5659

5760
/**
5861
* Creates an immutable {@link DbiFlagSet} containing dbiFlags.
62+
*
5963
* @param dbiFlags The flags to include in the {@link DbiFlagSet}.
6064
* @return An immutable {@link DbiFlagSet} containing dbiFlags.
6165
*/
@@ -65,6 +69,7 @@ static DbiFlagSet of(final Collection<DbiFlags> dbiFlags) {
6569

6670
/**
6771
* Create a builder for building an {@link DbiFlagSet}.
72+
*
6873
* @return A builder instance for building an {@link DbiFlagSet}.
6974
*/
7075
static AbstractFlagSet.Builder<DbiFlags, DbiFlagSet> builder() {

src/main/java/org/lmdbjava/DbiFlagSetEmpty.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@
1616
package org.lmdbjava;
1717

1818
class DbiFlagSetEmpty extends AbstractFlagSet.AbstractEmptyFlagSet<DbiFlags>
19-
implements DbiFlagSet {
20-
}
19+
implements DbiFlagSet {}

src/main/java/org/lmdbjava/Env.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public final class Env<T> implements AutoCloseable {
5555
public static final String DISABLE_CHECKS_PROP = "lmdbjava.disable.checks";
5656

5757
/**
58-
* The default {@link Charset} used to convert DB names from a byte[] to a String or
59-
* to encode a String as a byte[]. Only used if not explicit {@link Charset} is provided.
58+
* The default {@link Charset} used to convert DB names from a byte[] to a String or to encode a
59+
* String as a byte[]. Only used if not explicit {@link Charset} is provided.
6060
*/
6161
public static final Charset DEFAULT_NAME_CHARSET = StandardCharsets.UTF_8;
6262

src/main/java/org/lmdbjava/EnvFlagSet.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121
/** An immutable set of flags for use when opening the {@link Env}. */
2222
public interface EnvFlagSet extends FlagSet<EnvFlags> {
2323

24-
/**
25-
* An immutable empty {@link EnvFlagSet}.
26-
*/
24+
/** An immutable empty {@link EnvFlagSet}. */
2725
EnvFlagSet EMPTY = EnvFlagSetImpl.EMPTY;
2826

2927
/**
3028
* Gets the immutable empty {@link EnvFlagSet} instance.
29+
*
3130
* @return The immutable empty {@link EnvFlagSet} instance.
3231
*/
3332
static EnvFlagSet empty() {
@@ -36,6 +35,7 @@ static EnvFlagSet empty() {
3635

3736
/**
3837
* Creates an immutable {@link EnvFlagSet} containing envFlag.
38+
*
3939
* @param envFlag The flag to include in the {@link EnvFlagSet}
4040
* @return An immutable {@link EnvFlagSet} containing just envFlag.
4141
*/
@@ -46,6 +46,7 @@ static EnvFlagSet of(final EnvFlags envFlag) {
4646

4747
/**
4848
* Creates an immutable {@link EnvFlagSet} containing envFlags.
49+
*
4950
* @param envFlags The flags to include in the {@link EnvFlagSet}.
5051
* @return An immutable {@link EnvFlagSet} containing envFlags.
5152
*/
@@ -55,6 +56,7 @@ static EnvFlagSet of(final EnvFlags... envFlags) {
5556

5657
/**
5758
* Creates an immutable {@link EnvFlagSet} containing envFlags.
59+
*
5860
* @param envFlags The flags to include in the {@link EnvFlagSet}.
5961
* @return An immutable {@link EnvFlagSet} containing envFlags.
6062
*/
@@ -64,6 +66,7 @@ static EnvFlagSet of(final Collection<EnvFlags> envFlags) {
6466

6567
/**
6668
* Create a builder for building an {@link EnvFlagSet}.
69+
*
6770
* @return A builder instance for building an {@link EnvFlagSet}.
6871
*/
6972
static AbstractFlagSet.Builder<EnvFlags, EnvFlagSet> builder() {

0 commit comments

Comments
 (0)