All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.crums.model.TrailedRecord Maven / Gradle / Ivy

/*
 * Copyright 2020 Babak Farhang
 */
package io.crums.model;


import java.util.Objects;

/**
 * A "trailed" CrumRecord.
 */
public final class TrailedRecord extends CrumRecord {
  
  private final CrumTrail trail;

  /**
   * Creates an instance with the given crum trail.
   */
  public TrailedRecord(CrumTrail trail) {
    this.trail = Objects.requireNonNull(trail, "null trail");
  }

  /**
   * @return true
   */
  @Override
  public boolean isTrailed() {
    return true;
  }

  @Override
  public Crum crum() {
    return trail.crum();
  }

  /**
   * @return non-null
   */
  @Override
  public CrumTrail trail() {
    return trail;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy