Class Resource
- java.lang.Object
-
- com.github.m0nk3y2k4.thetvdb.internal.resource.Resource
-
- Direct Known Subclasses:
EpisodesAPI,LanguagesAPI,QueryResource
public abstract class Resource extends Object
General implementation for remote API resources.
Provides general functionality for the creation of URL path parameter based resource strings.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Predicate<Long>ID_VALIDATORValidator for the common dynamicidURL path parameterprotected static StringPATH_IDIdentifiers for common dynamic URL path parameters
-
Constructor Summary
Constructors Modifier Constructor Description protectedResource()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static StringcreateResource(String base, Object... pathParams)Creates a new resource string consisting of the givenbaseURL path parameter prepended by some optional route specific path parameters in the following format:/BASE/param1/param2/...protected static StringcreateResource(String base, String specific, Object... pathParams)Creates a new resource string consisting of the givenbaseandspecificURL path parameters prepended by some optional additional route path parameters in the following format:/BASE/specific/param1/param2/...
-
-
-
Field Detail
-
ID_VALIDATOR
protected static final Predicate<Long> ID_VALIDATOR
Validator for the common dynamicidURL path parameter
-
PATH_ID
protected static final String PATH_ID
Identifiers for common dynamic URL path parameters- See Also:
- Constant Field Values
-
-
Method Detail
-
createResource
protected static String createResource(@Nonnull String base, Object... pathParams)
Creates a new resource string consisting of the givenbaseURL path parameter prepended by some optional route specific path parameters in the following format:/BASE/param1/param2/...- Parameters:
base- Base URL path parameter which identifies a particular endpointpathParams- Optional additional path parameters to be prepended to the end of the resource string- Returns:
- Composed resource String based on the given parameters
-
createResource
protected static String createResource(@Nonnull String base, @CheckForNull String specific, Object... pathParams)
Creates a new resource string consisting of the givenbaseandspecificURL path parameters prepended by some optional additional route path parameters in the following format:/BASE/specific/param1/param2/...- Parameters:
base- Base URL path parameter which identifies a particular endpointspecific- Specific URL path parameter representing the actual route to be invokedpathParams- Optional additional path parameters to be prepended to the end of the resource string- Returns:
- Composed resource String based on the given parameters
-
-