Client constructor is package level protected
Closed this issue · 1 comments
Description
org.typesense.api.Client has a package protected constructor.
Client(Configuration configuration){ this.configuration = configuration; this.apiCall = new ApiCall(configuration); collections = new Collections(apiCall); this.individualCollections = new HashMap<>(); this.aliases = new Aliases(this.apiCall); this.individualAliases = new HashMap<>(); this.keys = new Keys(this.apiCall); this.individualKeys = new HashMap<Long, Key>(); this.health = new Health(this.apiCall); this.operations = new Operations(this.apiCall); this.metrics = new Metrics(this.apiCall); this.debug = new Debug(this.apiCall); this.multiSearch = new MultiSearch(this.apiCall); }
so when we try to run: new Client(configuration);
from outside the package the error:
error: Client(Configuration) is not public in Client; cannot be accessed from outside package
is displayed.
Steps to reproduce
- create a new java project
- add typesense-java as dependency
- create a method that initiate a TypeSense Client
Expected Behavior
Error: error: Client(Configuration) is not public in Client; cannot be accessed from outside package
Actual Behavior
the constructor should be public
or a factor pattern should be used.
Metadata
Typsense Version:
OS:
Fixed in v0.0.2
.