The library implements the com.google.gerrit.extensions.api.GerritApi interface. To use it, instantiate a GerritRestApiFactory, provide authentication data via GerritAuthData.Basic, and then create the GerritApi instance.
Supported authentication methods include HTTP basic, HTTP digest, LDAP with form, and HTTP password from Gerrit settings.
Note: If an interface is not yet implemented, the library will throw a com.google.gerrit.extensions.restapi.NotImplementedException.
GerritRestApiFactory gerritRestApiFactory = new GerritRestApiFactory();
// Use only the base URL
GerritAuthData.Basic authData = new GerritAuthData.Basic("http://localhost:8080");
// Or provide full credentials: authData = new GerritAuthData.Basic("https://example.com/gerrit", "user", "password");
GerritApi gerritApi = gerritRestApiFactory.create(authData);
// Example: Querying changes
List<ChangeInfo> changes = gerritApi.changes().query("status:merged").withLimit(10).get();