Package org.onyx.api
Class Token.ListBuilder
- Enclosing class:
Token
A builder class for querying tokens in the ledger.
List all tokens after a certain time:
Token.ItemIterable tokens = new Token.ListBuilder()
.setFilter("timestamp > $1")
.addFilterParameter("1985-10-26T01:21:00Z")
.getIterable(ledger);
for (Token token : tokens) {
System.out.println("timestamp: " + token.timestamp);
System.out.println("amount: " + token.amount);
}
-
Field Summary
Fields inherited from class org.onyx.api.BaseQueryBuilder
next -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIterable(Client client) Executes the query, returning an iterable over tokens that match the query.Executes the query, returning a page of tokens that match the query.Executes the query, returning a page of tokens that match the query beginning with provided cursor.Methods inherited from class org.onyx.api.BaseQueryBuilder
addFilterParameter, setFilter, setFilterParameters, setPageSize
-
Constructor Details
-
ListBuilder
public ListBuilder()
-
-
Method Details
-
getPage
Executes the query, returning a page of tokens that match the query.- Specified by:
getPagein classBaseQueryBuilder<Token.ListBuilder>- Parameters:
client- ledger API connection object- Returns:
- a page of tokens
- Throws:
ChainException
-
getPage
Executes the query, returning a page of tokens that match the query beginning with provided cursor.- Parameters:
client- ledger API connection objectcursor- string representing encoded query object- Returns:
- a page of tokens
- Throws:
ChainException
-
getIterable
Executes the query, returning an iterable over tokens that match the query.- Specified by:
getIterablein classBaseQueryBuilder<Token.ListBuilder>- Parameters:
client- ledger API connection object- Returns:
- an iterable over tokens
- Throws:
ChainException
-