io.crums.model.UntrailedRecord Maven / Gradle / Ivy
/*
* Copyright 2020 Babak Farhang
*/
package io.crums.model;
import java.util.Objects;
/**
* A CrumRecord
in the "untrailed" state.
*/
public class UntrailedRecord extends CrumRecord {
private final Crum crum;
/**
* Creates an instance using the given crum
.
*/
public UntrailedRecord(Crum crum) {
this.crum = Objects.requireNonNull(crum, "null crum");
}
/**
* Copy constructor.
*/
protected UntrailedRecord(UntrailedRecord copy) {
this.crum = Objects.requireNonNull(copy, "null copy instance").crum();
}
/**
* @return false
*/
@Override
public final boolean isTrailed() {
return false;
}
@Override
public final Crum crum() {
return crum;
}
/**
* @return null
*/
@Override
public final CrumTrail trail() {
return null;
}
}