java.lang.Object
dev.katsute.mal4j.MyAnimeList
The MyAnimeList API interface, used to execute requests with the API from Java.
The
The
MyAnimeList
class can be created by authenticating with either:
- A client ID using
withClientID(String)
- A token using
withToken(String)
- OAuth2 using
withOAuth2(MyAnimeListAuthenticator)
.
- Since:
- 1.0.0
- Version:
- 3.2.0
- Author:
- Katsute
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
deleteAnimeListing
(long id) Removes an Anime listing.abstract void
deleteMangaListing
(long id) Removes a Manga listing.abstract void
Enables an experimental feature.abstract AnimeSearchQuery
getAnime()
Returns an Anime search query.abstract Anime
getAnime
(long id) Returns the full Anime details given an ID.abstract Anime
Returns Anime details requested in the fields given an ID.abstract AnimeCharacterQuery
getAnimeCharacters
(long id) Returns characters for an Anime.abstract AnimeRankingQuery
getAnimeRanking
(AnimeRankingType rankingType) Returns an Anime ranking query.abstract AnimeRankingQuery
getAnimeRanking
(String rankingType) Returns an Anime ranking query.abstract AnimeSeasonQuery
getAnimeSeason
(int year, Season season) Returns an Anime season query.abstract AnimeSuggestionQuery
Returns an Anime suggestions query.abstract User
Returns the authenticated user.abstract User
getAuthenticatedUser
(String... fields) Returns the authenticated user.abstract Character
getCharacter
(long id) Returns a character.abstract Character
getCharacter
(long id, String... fields) Returns a character.abstract List
<ForumCategory> Returns the top level forum boards.abstract ForumTopicDetail
getForumTopicDetail
(long id) Returns a forum topic.abstract ForumTopicDetail
getForumTopicDetail
(long id, Integer limit) Returns a forum topic.abstract ForumTopicDetail
getForumTopicDetail
(long id, Integer limit, Integer offset) Returns a forum topic.abstract ForumTopicDetailPostQuery
getForumTopicDetailPostQuery
(long id) Returns a forum topic post query.abstract ForumSearchQuery
Returns a forum topic search query.abstract MangaSearchQuery
getManga()
Returns a Manga search query.abstract Manga
getManga
(long id) Returns the full Manga details given an ID.abstract Manga
Returns Manga details requested in the fields given an ID.abstract MangaRankingQuery
getMangaRanking
(MangaRankingType rankingType) Returns a Manga ranking query.abstract MangaRankingQuery
getMangaRanking
(String rankingType) Returns a Manga ranking query.abstract Person
getPerson
(long id) Returns a person.abstract Person
Returns a person.abstract User
Returns a user given their username.abstract User
Returns a user given their username.abstract UserAnimeListQuery
Returns a list query for your Anime listings.abstract UserAnimeListQuery
getUserAnimeListing
(String username) Returns a list query for a user's Anime listings.abstract UserMangaListQuery
Returns a list query for your Manga listings.abstract UserMangaListQuery
getUserMangaListing
(String username) Returns a list query for a user's Manga listings.abstract void
Refreshes the OAuth token.static void
setDebug
(boolean debug) Enable/disable connection debugging.abstract AnimeListUpdate
updateAnimeListing
(long id) Returns an Anime listing updater.abstract MangaListUpdate
updateMangaListing
(long id) Returns a Manga listing updater.static MyAnimeList
withClientID
(String client_id) Creates an interface with a client ID.static MyAnimeList
withOAuth2
(MyAnimeListAuthenticator authenticator) Creates an interface using an authenticator.static MyAnimeList
Creates an interface with an OAuth token.
-
Method Details
-
setDebug
public static void setDebug(boolean debug) Enable/disable connection debugging.- Parameters:
debug
- debug- Since:
- 2.7.0
-
withClientID
Creates an interface with a client ID. Only public read operations are allowed, for write and user operations usewithToken(String)
orwithOAuth2(MyAnimeListAuthenticator)
. Client secret is not required if your application has one.- Parameters:
client_id
- client id- Returns:
- MyAnimeList
- Throws:
NullPointerException
- if client ID is null- Since:
- 2.6.0
- See Also:
-
withToken
Creates an interface with an OAuth token. Note that this method does not supportrefreshToken()
.- Parameters:
token
- OAuth token, Ex: 'Bearer oauth2token'- Returns:
- MyAnimeList
- Throws:
NullPointerException
- if token is nullInvalidTokenException
- if token doesn't start with 'Bearer'- Since:
- 2.6.0
- See Also:
-
withOAuth2
Creates an interface using an authenticator.- Parameters:
authenticator
- authenticator- Returns:
- MyAnimeList
- Throws:
NullPointerException
- if authenticator is null- Since:
- 2.7.0
- See Also:
-
refreshToken
public abstract void refreshToken()Refreshes the OAuth token. Only works withwithOAuth2(MyAnimeListAuthenticator)
.- Throws:
UnsupportedOperationException
- if this wasn't created with an authenticator- Since:
- 2.6.0
-
enableExperimentalFeature
Enables an experimental feature.- Parameters:
feature
- feature to enable- Since:
- 2.3.0
- See Also:
-
getAnime
Returns an Anime search query.- Returns:
- Anime search
- Since:
- 1.0.0
- See Also:
-
getAnime
Returns the full Anime details given an ID.- Parameters:
id
- Anime id- Returns:
- Anime
- Since:
- 1.0.0
- See Also:
-
getAnime
Returns Anime details requested in the fields given an ID.- Parameters:
id
- Anime idfields
- a string array of the fields that should be returned- Returns:
- Anime
- Since:
- 1.0.0
- See Also:
-
getAnimeCharacters
Returns characters for an Anime.- Parameters:
id
- Anime id- Returns:
- Anime character query
- Since:
- 3.1.0
- See Also:
-
getAnimeRanking
Returns an Anime ranking query.- Parameters:
rankingType
- ranking type- Returns:
- ranked Anime
- Throws:
NullPointerException
- if ranking type is null- Since:
- 1.0.0
- See Also:
-
getAnimeRanking
Returns an Anime ranking query.
It is recommended to usegetAnimeRanking(AnimeRankingType)
rather than this method. This method should only be used if you are using a ranking type that is missing fromAnimeRankingType
.- Parameters:
rankingType
- ranking type API field- Returns:
- ranked Anime
- Throws:
NullPointerException
- if ranking type is null- Since:
- 2.9.0
- See Also:
-
getAnimeSeason
Returns an Anime season query.- Parameters:
year
- yearseason
- airing season- Returns:
- seasonal Anime
- Throws:
NullPointerException
- if season is null- Since:
- 1.0.0
- See Also:
-
getAnimeSuggestions
Returns an Anime suggestions query.- Returns:
- suggested Anime
- Since:
- 1.0.0
- See Also:
-
updateAnimeListing
Returns an Anime listing updater.- Parameters:
id
- Anime id- Returns:
- Anime list updater
- Since:
- 1.0.0
- See Also:
-
deleteAnimeListing
public abstract void deleteAnimeListing(long id) Removes an Anime listing.- Parameters:
id
- Anime id- Since:
- 1.0.0
- See Also:
-
getUserAnimeListing
Returns a list query for your Anime listings.- Returns:
- Anime listing
- Since:
- 1.0.0
- See Also:
-
getUserAnimeListing
Returns a list query for a user's Anime listings.- Parameters:
username
- username- Returns:
- Anime listing
- Throws:
NullPointerException
- if username is null- Since:
- 1.0.0
- See Also:
-
getCharacter
Returns a character.- Parameters:
id
- character id- Returns:
- character
- Since:
- 3.1.0
- See Also:
-
getCharacter
Returns a character.- Parameters:
id
- character idfields
- a string array of the fields that should be returned- Returns:
- character
- Since:
- 3.1.0
- See Also:
-
getPerson
Returns a person.- Parameters:
id
- person id- Returns:
- person
- Since:
- 3.2.0
- See Also:
-
getPerson
Returns a person.- Parameters:
id
- person idfields
- a string array of the fields that should be returned- Returns:
- person
- Since:
- 3.2.0
- See Also:
-
getForumBoards
Returns the top level forum boards.- Returns:
- forum boards
- Since:
- 1.0.0
- See Also:
-
getForumTopicDetail
Returns a forum topic.- Parameters:
id
- forum topic id- Returns:
- forum topic
- Since:
- 1.0.0
- See Also:
-
getForumTopicDetail
Returns a forum topic.- Parameters:
id
- forum topic idlimit
- post limit- Returns:
- forum topic
- Since:
- 1.0.0
- See Also:
-
getForumTopicDetail
Returns a forum topic.- Parameters:
id
- forum topic idlimit
- post limitoffset
- post offset- Returns:
- forum topic
- Since:
- 1.0.0
- See Also:
-
getForumTopicDetailPostQuery
Returns a forum topic post query.- Parameters:
id
- forum topic id- Returns:
- post search
- Since:
- 2.0.0
- See Also:
-
getForumTopics
Returns a forum topic search query.- Returns:
- forums
- Since:
- 1.0.0
- See Also:
-
getManga
Returns a Manga search query.- Returns:
- Manga search
- Since:
- 1.0.0
- See Also:
-
getManga
Returns the full Manga details given an ID.- Parameters:
id
- Manga id- Returns:
- Manga
- Since:
- 1.0.0
- See Also:
-
getManga
Returns Manga details requested in the fields given an ID.- Parameters:
id
- Manga idfields
- a string array of the fields that should be returned- Returns:
- Manga
- Since:
- 1.0.0
- See Also:
-
getMangaRanking
Returns a Manga ranking query.- Parameters:
rankingType
- ranking type- Returns:
- ranked Manga
- Throws:
NullPointerException
- if ranking type is null- Since:
- 1.0.0
- See Also:
-
getMangaRanking
Returns a Manga ranking query.
It is recommended to usegetMangaRanking(MangaRankingType)
rather than this method. This method should only be used if you are using a ranking type that is missing fromMangaRankingType
.- Parameters:
rankingType
- ranking type API field- Returns:
- ranked Manga
- Throws:
NullPointerException
- if ranking type is null- Since:
- 2.9.0
- See Also:
-
updateMangaListing
Returns a Manga listing updater.- Parameters:
id
- Manga id- Returns:
- Manga list updater
- Since:
- 1.0.0
- See Also:
-
deleteMangaListing
public abstract void deleteMangaListing(long id) Removes a Manga listing.- Parameters:
id
- Manga id- Since:
- 1.0.0
- See Also:
-
getUserMangaListing
Returns a list query for your Manga listings.- Returns:
- Manga listing
- Since:
- 1.0.0
- See Also:
-
getUserMangaListing
Returns a list query for a user's Manga listings.- Parameters:
username
- username- Returns:
- Manga listing
- Throws:
NullPointerException
- if username is null- Since:
- 1.0.0
- See Also:
-
getAuthenticatedUser
Returns the authenticated user.- Returns:
- authenticated user
- Since:
- 2.2.0
- See Also:
-
getAuthenticatedUser
Returns the authenticated user.- Parameters:
fields
- a string array of the fields that should be returned- Returns:
- authenticated user
- Since:
- 2.2.0
- See Also:
-
getUser
Returns a user given their username.- Parameters:
username
- username- Returns:
- user
- Throws:
NullPointerException
- if username is null- Since:
- 1.0.0
- See Also:
-
getUser
Returns a user given their username.- Parameters:
username
- usernamefields
- a string array of the fields that should be returned- Returns:
- user
- Throws:
NullPointerException
- if username is null- Since:
- 1.0.0
- See Also:
-