/*
 * 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 org.spine3.server.entity.storage;

/**
 * // TODO:2017-03-27:dmytro.dashenkov: Complete javadoc.
 *
 * @param <J> the Java type represented by the column
 * @param <S> the "store as" type of the column
 * @param <R> the type of the record in the database, which holds a single tuple of data and which
 *          generated by the storage to on write
 * @param <C> the type of the column identifier in the {@code R}
 */
public interface ColumnType<J, S, R, C> {

    S convert(J fieldValue);

    void set(R storageRecord, S value, C columnIdentifier);
}

@@ -1064,61 +1064,72 @@
 %0A * 
-// TODO:2017-03-27:dmytro.dashenkov: Complete javadoc
+An interface for handling type conversion for the storage fields
 .%0A *
@@ -1342,16 +1342,18 @@
         
+  
 generate
@@ -1501,33 +1501,957 @@
     
-S convert(J fieldValue);%0A
+/**%0A     * Converts the Storage Field type specified in%0A     * the %7B@link org.spine3.server.entity.Entity Entity%7D declaration to the type in which the field%0A     * is stored.%0A     *%0A     * %3Cp%3ECommon example is converting%0A     * %7B@link com.google.protobuf.Timestamp %7B@literal com.google.protobuf.Timestamp%7D%7D into%0A     * %7B@link java.util.Date %7B@literal java.util.Date%7D%7D.%0A     *%0A     * @param fieldValue the Storage Field of the initial type%0A     * @return the Storage Field of the %22store as%22 type%0A     */%0A    S convert(J fieldValue);%0A%0A    /**%0A     * Set the Storage Field value to the database record type.%0A     *%0A     * %3Cp%3ECommon example is setting a value to%0A     * a %7B@link java.sql.PreparedStatement PreparedStatement%7D instance into a determined position.%0A     *%0A     * @param storageRecord    the database record%0A     * @param value            the value to store%0A     * @param columnIdentifier the identifier of the column, e.g. its index%0A     */
 %0A   

Document `ColumnType`.