@Override protected Result doApply(final Context context, @Nullable final Thing thing, final long nextRevision, final RetrieveThing command) { return command.getSnapshotRevision() .map(snapshotRevision -> getRetrieveThingFromSnapshotterResult(snapshotRevision, context, command)) .orElseGet(() -> ResultFactory.newQueryResult(command, thing, getRetrieveThingResponse(thing, command), this)); }
@Override protected Result doApply(final Context context, @Nullable final Thing thing, final long nextRevision, final RetrieveThing command) { return command.getSnapshotRevision() .map(snapshotRevision -> getRetrieveThingFromSnapshotterResult(snapshotRevision, context, command)) .orElseGet(() -> ResultFactory.newQueryResult(command, thing, getRetrieveThingResponse(thing, command), this)); }