/*
 * Copyright 2017, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package io.spine.server.storage;

import io.spine.annotation.Internal;

/**
 * A read request for {@link Storage}.
 *
 * <p>Purpose of this interface is generalization of the parameter
 * for a record {@linkplain Storage#read(ReadRequest) reading}.
 *
 * <p>This generalization is required, because {@code ID} is not always sufficient parameter
 * to read a record. Implementations may specify other filtering parameters or even
 * configuration for a read execution. E.g. to read a record, reading of which causes
 * reading of a list of other records, a batch size will be handy and it can be specified as a
 * parameter of a read request.
 *
 * @param <I> the type of the record ID
 * @author Dmytro Grankin
 */
@Internal
public interface ReadRequest<I> {

    /**
     * Obtains the ID of the requested record.
     *
     * <p>The result of this request must have this ID.
     *
     * @return the record ID
     */
    I getId();
}

@@ -1097,22 +1097,46 @@
 A re
-ad request for
+quest to read a particular record from
  %7B@l
@@ -1158,17 +1158,19 @@
 *%0A * %3Cp%3E
-P
+A p
 urpose o
@@ -1175,513 +1175,210 @@
  of 
-this interface is generalization of the parameter%0A * for a record %7B@linkplain Storage#read(ReadRequest) reading%7D.%0A *%0A * %3Cp%3EThis generalization is required, because %7B@code ID%7D is not always sufficient parameter%0A * to read a record. Implementations may specify other filtering parameters or even%0A * configuration for a read execution. E.g. to read a record, reading of which causes%0A * reading of a list of other records, a batch size will be handy and it can be specified as a%0A * parameter of a read request
+having a general contract for such requests is to allow %7B@link Storage%7D%0A * implementations to take some additional parameters, that may help to read a record in%0A * a more optimal way, than just by an ID
 .%0A *

Improve Javadocs for `ReadRequest`