當前位置: 首頁>>代碼示例>>Java>>正文


Java Episode類代碼示例

本文整理匯總了Java中com.uwetrottmann.thetvdb.entities.Episode的典型用法代碼示例。如果您正苦於以下問題:Java Episode類的具體用法?Java Episode怎麽用?Java Episode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Episode類屬於com.uwetrottmann.thetvdb.entities包,在下文中一共展示了Episode類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: assertBasicEpisode

import com.uwetrottmann.thetvdb.entities.Episode; //導入依賴的package包/類
public static void assertBasicEpisode(Episode episode) {
    assertThat(episode.id).isPositive();
    assertThat(episode.airedEpisodeNumber).isGreaterThanOrEqualTo(0);
    if (episode.absoluteNumber != null) {
        assertThat(episode.absoluteNumber).isGreaterThanOrEqualTo(0);
    }
    if (episode.dvdEpisodeNumber != null) {
        assertThat(episode.dvdEpisodeNumber).isGreaterThanOrEqualTo(0);
    }
    if (episode.dvdSeason != null) {
        assertThat(episode.dvdSeason).isGreaterThanOrEqualTo(0);
    }
    assertThat(episode.airedSeason).isGreaterThanOrEqualTo(0);
    if (episode.airedSeasonID != null) {
        assertThat(episode.airedSeasonID).isPositive();
    }
    if (episode.episodeName != null) {
        assertThat(episode.language.episodeName).isEqualTo(LANGUAGE_EN);
    }
    if (episode.overview != null) {
        assertThat(episode.language.overview).isEqualTo(LANGUAGE_EN);
    }
}
 
開發者ID:UweTrottmann,項目名稱:thetvdb-java,代碼行數:24,代碼來源:TestData.java

示例2: getAllEpisodes

import com.uwetrottmann.thetvdb.entities.Episode; //導入依賴的package包/類
public List<TheTVDBEpisode> getAllEpisodes(int tvdbid, String language) throws TheTVDBException {
	try {
		if (tvdbid != 0) {
			Response<EpisodesResponse> response = theTvdb.series().episodes(tvdbid, 1, language).execute();
			if (response.isSuccessful()) {
				List<TheTVDBEpisode> tvdpEpisodes = new ArrayList<>();
				for (Episode episode : response.body().data) {
					tvdpEpisodes.add(episodeToTVDBEpisode(episode, language));
				}
				return tvdpEpisodes;
			}
		} else {
			LOGGER.warn("TVDB ID is 0! please fix");
		}
		return null;
	} catch (IOException e) {
		throw new TheTVDBException(e);
	}
}
 
開發者ID:phdelodder,項目名稱:SubTools,代碼行數:20,代碼來源:TheTVDBApiV2.java

示例3: episodeToTVDBEpisode

import com.uwetrottmann.thetvdb.entities.Episode; //導入依賴的package包/類
private TheTVDBEpisode episodeToTVDBEpisode(Episode episode, String lang) {
	TheTVDBEpisode tvdbEpisode = new TheTVDBEpisode();

	tvdbEpisode.setId(toString(episode.id));
	tvdbEpisode.setDvdEpisodeNumber(toString(episode.dvdEpisodeNumber));
	tvdbEpisode.setDvdSeason(toString(episode.dvdSeason));
	tvdbEpisode.setEpisodeName(episode.episodeName);
	tvdbEpisode.setEpisodeNumber(episode.airedEpisodeNumber);
	tvdbEpisode.setFirstAired(episode.firstAired);
	tvdbEpisode.setLanguage(lang);
	tvdbEpisode.setOverview(episode.language.overview);
	tvdbEpisode.setSeasonNumber(episode.airedSeason);
	tvdbEpisode.setAbsoluteNumber(toString(episode.absoluteNumber));
	tvdbEpisode.setLastUpdated(toString(episode.lastUpdated));
	tvdbEpisode.setSeasonId(toString(episode.airedSeasonID));
	tvdbEpisode.setAirsAfterSeason(0);
	tvdbEpisode.setAirsBeforeEpisode(0);
	
	return tvdbEpisode;
}
 
開發者ID:phdelodder,項目名稱:SubTools,代碼行數:21,代碼來源:TheTVDBApiV2.java

示例4: assertEpisodes

import com.uwetrottmann.thetvdb.entities.Episode; //導入依賴的package包/類
private static void assertEpisodes(@Nullable List<Episode> episodes) {
    if (episodes == null) {
        fail("episodes == null");
    }
    for (Episode episode : episodes) {
        TestData.assertBasicEpisode(episode);
    }
}
 
開發者ID:UweTrottmann,項目名稱:thetvdb-java,代碼行數:9,代碼來源:TheTvdbSeriesTest.java

示例5: test_get

import com.uwetrottmann.thetvdb.entities.Episode; //導入依賴的package包/類
@Test
public void test_get() throws Exception {
    EpisodeResponse episodeResponse = executeCall(
            getTheTvdb().episodes().get(TestData.EPISODE_TVDB_ID, TestData.LANGUAGE_EN));
    Episode.FullEpisode episode = episodeResponse.data;
    TestData.assertBasicEpisode(episode);
    assertThat(episode.id).isEqualTo(TestData.EPISODE_TVDB_ID);
}
 
開發者ID:UweTrottmann,項目名稱:thetvdb-java,代碼行數:9,代碼來源:TheTvdbEpisodesTest.java


注:本文中的com.uwetrottmann.thetvdb.entities.Episode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。