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_VALIDATOR
Validator for the common dynamicid
URL path parameterprotected static String
PATH_ID
Identifiers for common dynamic URL path parameters
-
Constructor Summary
Constructors Modifier Constructor Description protected
Resource()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static String
createResource(String base, Object... pathParams)
Creates a new resource string consisting of the givenbase
URL path parameter prepended by some optional route specific path parameters in the following format:/BASE/param1/param2/...
protected static String
createResource(String base, String specific, Object... pathParams)
Creates a new resource string consisting of the givenbase
andspecific
URL 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 dynamicid
URL 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 givenbase
URL 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 givenbase
andspecific
URL 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
-
-