当前位置: 首页>>代码示例>>Java>>正文


Java Distribution.setTemporal方法代码示例

本文整理汇总了Java中org.gbif.api.model.checklistbank.Distribution.setTemporal方法的典型用法代码示例。如果您正苦于以下问题:Java Distribution.setTemporal方法的具体用法?Java Distribution.setTemporal怎么用?Java Distribution.setTemporal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gbif.api.model.checklistbank.Distribution的用法示例。


在下文中一共展示了Distribution.setTemporal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: interpretDistribution

import org.gbif.api.model.checklistbank.Distribution; //导入方法依赖的package包/类
private void interpretDistribution(NameUsage u, UsageExtensions e, VerbatimNameUsage v) {
  if (v.hasExtension(Extension.DISTRIBUTION)) {
    for (Map<Term, String> rec : v.getExtensions().get(Extension.DISTRIBUTION)) {
      Distribution d = new Distribution();
      // interpret rec
      d.setLocality(value(rec, DwcTerm.locality));
      d.setLocationId(value(rec, DwcTerm.locationID));
      d.setCountry(enumify(rec, NameUsageIssue.DISTRIBUTION_INVALID, countryParser, u, DwcTerm.country, DwcTerm.countryCode));
      // some location is required, otherwise its pointless
      if (d.getLocality() == null && d.getLocationId() == null && d.getCountry() == null) {
        u.addIssue(NameUsageIssue.DISTRIBUTION_INVALID);
        continue;
      }
      d.setStatus(enumify(rec, NameUsageIssue.DISTRIBUTION_INVALID, occurrenceStatusParser, u, DwcTerm.occurrenceStatus));
      d.setEstablishmentMeans(enumify(rec, NameUsageIssue.DISTRIBUTION_INVALID, establishmentMeansParser, u, DwcTerm.establishmentMeans));
      d.setAppendixCites(enumify(rec, NameUsageIssue.DISTRIBUTION_INVALID, citesAppendixParser, u, GbifTerm.appendixCITES));
      d.setThreatStatus(enumify(rec, NameUsageIssue.DISTRIBUTION_INVALID, threatStatusParser, u, IucnTerm.threatStatus));
      d.setLifeStage(enumify(rec, NameUsageIssue.DISTRIBUTION_INVALID, lifeStageParser, u, DwcTerm.lifeStage));
      d.setTemporal(value(rec, DwcTerm.eventDate, DcTerm.temporal));
      d.setEndDayOfYear(integer(rec, NameUsageIssue.DISTRIBUTION_INVALID, u, DwcTerm.endDayOfYear));
      d.setStartDayOfYear(integer(rec, NameUsageIssue.DISTRIBUTION_INVALID, u, DwcTerm.startDayOfYear));
      d.setRemarks(value(rec, DwcTerm.occurrenceRemarks, DwcTerm.taxonRemarks));
      d.setSource(value(rec, DcTerm.source));
      e.distributions.add(d);
    }
  }
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:28,代码来源:ExtensionInterpreter.java

示例2: testMapper

import org.gbif.api.model.checklistbank.Distribution; //导入方法依赖的package包/类
@Test
public void testMapper() throws Exception {
    assertTrue(mapper.listByChecklistUsage(usageKey, new PagingRequest()).isEmpty());
    assertTrue(mapper.listByNubUsage(usageKey, new PagingRequest()).isEmpty());

    Distribution obj = new Distribution();
    obj.setAppendixCites(CitesAppendix.II);
    obj.setCountry(Country.ALGERIA);
    obj.setEndDayOfYear(1990);
    obj.setEstablishmentMeans(EstablishmentMeans.NATIVE);
    obj.setLifeStage(LifeStage.EMRYO);
    obj.setLocality("location location location");
    obj.setLocationId("locID");
    obj.setRemarks("remarks");
    obj.setStartDayOfYear(1989);
    obj.setStatus(OccurrenceStatus.COMMON);
    obj.setTemporal("aha");
    obj.setThreatStatus(ThreatStatus.CRITICALLY_ENDANGERED);
    // these should get ignored
    obj.setSource("sourcy s");
    obj.setSourceTaxonKey(123);

    mapper.insert(usageKey, obj, citationKey1);

    Distribution obj2 = mapper.listByChecklistUsage(usageKey, new PagingRequest()).get(0);
    assertObject(obj, obj2, citation1, null);


    obj2 = mapper.listByNubUsage(nubKey, new PagingRequest()).get(0);
    // these are now nub source usage values
    assertObject(obj, obj2, datasetTitle, usageKey);
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:33,代码来源:DistributionMapperTest.java


注:本文中的org.gbif.api.model.checklistbank.Distribution.setTemporal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。