예제 #1
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);
  }
예제 #2
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);
  }