tronalddump.io client-java

tronalddump.io api client library for java

License

License

Categories

Categories

Java Languages CLI User Interface
GroupId

GroupId

io.tronalddump
ArtifactId

ArtifactId

client-java
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

tronalddump.io client-java
tronalddump.io api client library for java
Project URL

Project URL

https://github.com/tronalddump-io/client-java
Source Code Management

Source Code Management

https://github.com/tronalddump-io/client-java

Download client-java

How to add to project

<!-- https://jarcasting.com/artifacts/io.tronalddump/client-java/ -->
<dependency>
    <groupId>io.tronalddump</groupId>
    <artifactId>client-java</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.tronalddump/client-java/
implementation 'io.tronalddump:client-java:1.0.0'
// https://jarcasting.com/artifacts/io.tronalddump/client-java/
implementation ("io.tronalddump:client-java:1.0.0")
'io.tronalddump:client-java:jar:1.0.0'
<dependency org="io.tronalddump" name="client-java" rev="1.0.0">
  <artifact name="client-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.tronalddump', module='client-java', version='1.0.0')
)
libraryDependencies += "io.tronalddump" % "client-java" % "1.0.0"
[io.tronalddump/client-java "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.json : json jar 20160810

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

Official tronalddump.io api client for Java

Maven Central Javadocs Apache 2.0 License

Tronalddump.io is a free api and web archive for the dumbest things Donald Trump has ever said ...

Installation

Add the dependency to your project:

Maven:

<dependency>
  <groupId>io.tronalddump</groupId>
  <artifactId>client-java</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle:

dependencies {
    compile "io.tronalddump:client-java:1.0.0"
}

Usage

// Create the Tronald client
TronaldClient client = new TronaldClient();

// Retrieve a Tronald quote by its id
Quote quote = client.getQuote("wAgIgzV1S9OARKhfun3f0A");
System.out.println(quote.getValue());

// Retrieve a random Tronald quote
Quote quote = client.getRandomQuote();
System.out.println(quote.getValue());

// Retrieve a random Tronald quote tagged with "Hillary Clinton"
Quote quote = client.getRandomQuote("Hillary Clinton");
System.out.println(quote.getValue());

// Perform a free text search
Page<Quote> page = client.search("clinton");
for (Quote quote : page) {
    System.out.println(quote.getValue());
}

// Retrieve the next page in the search result 
if (page.hasNext() {
    Page<quote> nextPage = client.search("clinton", page.nextPageable());
    ..
}

// Perform a free text search with a different page size
Page<Quote> page = client.search("clinton", 10);
for (Quote quote : page) {
    System.out.println(quote.getValue());
}

// Or even customize the pagination completely with the PageableBuilder
import static io.tronalddump.client.Pageable.PageableBuilder.aPageable;

Page<Quote> page = client.search("clinton", aPageable().withPage(1).withSize(5).build());
for (Quote quote : page) {
    System.out.println(quote.getValue());
}

License

This software is released under version 2.0 of the Apache License.

io.tronalddump

TRONALD DUMP

Versions

Version
1.0.0