本文整理汇总了Java中java.time.OffsetDateTime.isAfter方法的典型用法代码示例。如果您正苦于以下问题:Java OffsetDateTime.isAfter方法的具体用法?Java OffsetDateTime.isAfter怎么用?Java OffsetDateTime.isAfter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.time.OffsetDateTime
的用法示例。
在下文中一共展示了OffsetDateTime.isAfter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadChangedSince
import java.time.OffsetDateTime; //导入方法依赖的package包/类
@Override public FeatureCollection loadChangedSince(String group, OffsetDateTime since) {
logger.info("{}", kvp("op", "loadFeaturesSince", "group", group, "since", since));
final List<Feature> sinceList = Lists.newArrayList();
final List<Feature> list = loadFeatures(group).getItemsList();
for (Feature feature : list) {
final OffsetDateTime time = TimeSupport.asOffsetDateTime(feature.getUpdated());
if (time.isAfter(since)) {
sinceList.add(feature);
}
}
sinceList.sort(byUpdatedOrdering);
return FeatureCollection.newBuilder()
.addAllItems(sinceList)
.setGroup(group)
.build();
}
示例2: hasExpired
import java.time.OffsetDateTime; //导入方法依赖的package包/类
public boolean hasExpired() {
OffsetDateTime expirationDateTime = OffsetDateTime.ofInstant(
Instant.ofEpochSecond(expirationTime), ZoneId.systemDefault());
OffsetDateTime now = OffsetDateTime.now(ZoneId.systemDefault());
return now.isAfter(expirationDateTime);
}
示例3: after
import java.time.OffsetDateTime; //导入方法依赖的package包/类
static private Matcher<OffsetDateTime> after(final OffsetDateTime border) {
return new TypeSafeMatcher<OffsetDateTime>() {
@Override
public void describeTo(Description description) {
description.appendText("Timestamp after " + border);
}
@Override
protected boolean matchesSafely(OffsetDateTime item) {
return item.isAfter(border);
}
};
}
示例4: test_isAfter_null
import java.time.OffsetDateTime; //导入方法依赖的package包/类
@Test(expectedExceptions=NullPointerException.class)
public void test_isAfter_null() {
OffsetDateTime a = OffsetDateTime.of(2008, 6, 30, 11, 30, 59, 0, OFFSET_PONE);
a.isAfter(null);
}