Skip to content

Commit 48ed141

Browse files
nwsescottf
andauthored
Add Options.builder() method to get the builder in a more "fluent" manner (#832)
* Add `Options#builder()` (Resolves #831) * Rename builder method. Co-authored-by: Scott Fauerbach <[email protected]>
1 parent fd2df06 commit 48ed141

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/io/nats/client/Options.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,19 @@ public Thread newThread(Runnable r) {
571571
* be created from a properties object using the property names defined with the
572572
* prefix PROP_ in this class.
573573
*
574-
* <p>{@code new Options.Builder().build()} is equivalent to calling {@link Nats#connect() Nats.connect()}.
574+
* <p>{@code new Options.Builder().build()}}.
575575
*
576576
* <p>A common usage for testing might be {@code new Options.Builder().server(myserverurl).noReconnect.build()}
577577
*/
578+
579+
/**
580+
* Creates a builder for the options.
581+
* @return the builder.
582+
*/
583+
public static Builder builder() {
584+
return new Builder();
585+
}
586+
578587
public static class Builder {
579588

580589
// ----------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)