-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from FalkorDB/jdoc
add more factories
- Loading branch information
Showing
3 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,57 @@ | ||
package com.falkordb; | ||
|
||
import java.net.URI; | ||
|
||
import com.falkordb.impl.api.DriverImpl; | ||
|
||
/** | ||
* FalkorDB driver factory | ||
*/ | ||
final public class FalkorDB { | ||
|
||
private FalkorDB() {} | ||
private FalkorDB() { | ||
} | ||
|
||
/** | ||
* Creates a new driver instance | ||
* | ||
* @return a new driver instance | ||
*/ | ||
public static Driver driver (){ | ||
return new DriverImpl(); | ||
public static Driver driver() { | ||
return driver("localhost", 6379); | ||
} | ||
|
||
/** | ||
* Creates a new driver instance | ||
* | ||
* @param host host name | ||
* @param port port number | ||
* @return a new driver instance | ||
*/ | ||
public static Driver driver (String host, int port){ | ||
public static Driver driver(String host, int port) { | ||
return new DriverImpl(host, port); | ||
} | ||
|
||
/** | ||
* Creates a new driver instance | ||
* | ||
* @param host host name | ||
* @param port port number | ||
* @param user username | ||
* @param password password | ||
* @return a new driver instance | ||
*/ | ||
public static Driver driver(String host, int port, String user, final String password) { | ||
return new DriverImpl(host, port, user, password); | ||
} | ||
|
||
/** | ||
* Creates a new driver instance | ||
* | ||
* @param uri server uri | ||
* @return a new driver instance | ||
*/ | ||
public static Driver driver(URI uri) { | ||
return new DriverImpl(uri); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters