gpt4 book ai didi

org.threeten.extra.YearQuarter.isBefore()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 00:20:31 25 4
gpt4 key购买 nike

本文整理了Java中org.threeten.extra.YearQuarter.isBefore()方法的一些代码示例,展示了YearQuarter.isBefore()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearQuarter.isBefore()方法的具体详情如下:
包路径:org.threeten.extra.YearQuarter
类名称:YearQuarter
方法名:isBefore

YearQuarter.isBefore介绍

[英]Is this year-quarter before the specified year-quarter.
[中]是指定年度季度之前的本年度季度。

代码示例

代码示例来源:origin: hibernate/hibernate-demos

public boolean isValid(YearQuarter value, ConstraintValidatorContext context) {
    if ( value == null ) {
      return true;
    }
    return YearQuarter.now().isBefore( value );
  }
}

代码示例来源:origin: org.threeten/threeten-extra

/**
 * Returns a sequential ordered stream of year-quarter. The returned stream starts from this year-quarter
 * (inclusive) and goes to {@code endExclusive} (exclusive) by an incremental step of 1 {@code QUARTER_YEARS}.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @param endExclusive  the end year-quarter, exclusive, not null
 * @return a sequential {@code Stream} for the range of {@code YearQuarter} values
 * @throws IllegalArgumentException if end year-quarter is before this year-quarter
 */
public Stream<YearQuarter> quartersUntil(YearQuarter endExclusive) {
  if (endExclusive.isBefore(this)) {
    throw new IllegalArgumentException(endExclusive + " < " + this);
  }
  long intervalLength = until(endExclusive, QUARTER_YEARS);
  return LongStream.range(0,intervalLength).mapToObj(n -> plusQuarters(n));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com