当前位置: 首页>>代码示例>>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;未经允许,请勿转载。