示例#1
0
  @Override
  public <A> A get(AttributeKey<A> key, A defaultValue) {

    if (key == ChronoHistory.ATTRIBUTE_CUTOVER_DATE) {
      if (this.cutover == null) {
        return defaultValue;
      } else {
        return key.type().cast(this.cutover);
      }
    }

    return this.attributes.get(key, defaultValue);
  }
示例#2
0
  @Override
  public <A> A get(AttributeKey<A> key) {

    if (key == ChronoHistory.ATTRIBUTE_CUTOVER_DATE) {
      if (this.cutover == null) {
        throw new NoSuchElementException(key.name());
      } else {
        return key.type().cast(this.cutover);
      }
    }

    return this.attributes.get(key);
  }