private boolean canChangeTo(State state) {
        // Allow repeated restores
        if (state == State.restoring && this.state == State.restored) return true;
        // Otherwise only allow state changes in the order of the state enum, and at most one step at a time
        return state.compareTo(this.state) >= 0 &&
               state.ordinal() - this.state.ordinal() <= 1;
    }
Returns how long this snapshot has been idle at given instant
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/backup/Snapshot.java