Skip to content

goulashify/java-random-org

Repository files navigation

random_org_api

API client for using random.org's api, it's WIP.

Synopsis.

String myApiKey;
RandomApiContext context = new RandomApiContext(myApiKey);
Response<Result<String>> response = RandomApiClient.generateStrings(context, 10, 5);

if (!response.isSuccessful()) {
    // check response.getError().getData() to find additional data coming from the server
    // check response.getError().getCode() to find the code, or .getMessage() for the message
}

List<String> randomStrings = response.getResult().getRandom().getData();
DateTime completionTime = response.getResult().getRandom().getCompletionTime();

// Each response comes with additional information about availability.
Integer bitsLeft = response.getResult().getBitsLeft();
Integer requestsLeft = response.getResult().getRequestsLeft();
Integer advisoryDelay = response.getResult().getAdvisoryDelay();

About

Client for api.random.org in java.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages