[JAVA-2748] Create a ServerAddress with default host Created: 24/Jan/18  Updated: 07/Apr/23  Resolved: 31/Jan/18

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Farès Hassak Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hello,

Add a constructor that creates a ServerAddress with default host (127.0.0.1)

   /**
     * Creates a ServerAddress with default host
     *
     * @param port mongod port
     */
    public ServerAddress(final int port) { this(defaultHost(), port); }

Usage :

new ServerAddress(27018);

Farès



 Comments   
Comment by Jeffrey Yemin [ 31/Jan/18 ]

Discussion on the linked pull request led to a decision not to do this. Closing as Won't Fix.

Comment by Farès Hassak [ 24/Jan/18 ]

https://github.com/mongodb/mongo-java-driver/pull/445

Generated at Thu Feb 08 08:57:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.