Package-level declarations
Types
Link copied to clipboard
"@RequestPath"
annotation is applied to those methods offered by libraries that allow to make a request.Link copied to clipboard
"@RequestWeight"
annotation is applied to those methods offered by libraries that allow to make a request.Link copied to clipboard
The
"@Returner"
annotation is applied to those methods offered by libraries in which the response of an API request is processed and formatted according to a specific type of format
//This method is an example returner method
//ReturnFormat is for the example, but could be any type of formatter
private <T> T returnResponseFormatted(T responseDetails, ReturnFormat format) {
switch (format) {
case JSON:
return // response formatted as JSON
case LIBRARY_OBJECT:
return // response formatted as object given by the library
default: // this case is the STRING case
return // response formatted as simple string
}
}
Content copied to clipboard
Link copied to clipboard
"@Structure"
annotation is applied to those classes that give a general structure and a general behavior in a possible hierarchy and to its subclassesLink copied to clipboard
The
"@WrappedRequest"
annotation is applied to those methods offered by libraries where the original request of the API service involved are "wrapped"
by the methods of the library, that is, the possible combinations with any parameters of the original request are easily added to this request with the "wrapped"
method marked with this annotation
// original params (NOT MANDATORY) of the API service: maxResults (int), includeAnyThing (boolean)
// original request
public void () {
sendApiRequest();
}
public void makeRequest(int maxResults){
sendApiRequest(maxResults);
}
public void makeRequest(boolean includeAnyThing){
sendApiRequest(includeAnyThing);
}
public void makeRequest(int maxResults, boolean includeAnyThing){
sendApiRequest(maxResults, includeAnyThing);
}
Content copied to clipboard
Link copied to clipboard
The
"@Wrapper"
annotation is applied to those wrapper methods that wrap the main method facilitating access to this last one avoiding passing some useless arguments
//This method is an example wrapper method
//In this case the useless argument is the 0
= "sum(double x, double y, int decimals)")
public double sum(double x, double y) {
return sum(x, y, 0);
}
//This method is an example wrapped method
//In this case the wrapped argument is the decimals
public double sum(double x, double y, int decimals) {
return TradingTools.roundValue(x + y, decimals);
}
Content copied to clipboard