All Downloads are FREE. Search and download functionalities are using the official Maven repository.

acolyte.jdbc.Row Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package acolyte.jdbc;

import java.util.List;

/**
 * Row marker interface
 */
public interface Row {
    /**
     * Returns information for cell(s) of row.
     * Each cell is decribed with a value (left) and an optional value (right).
     *
     * @return the cells of this row
     */
    public List cells();

    // --- Shared ---

    /**
     * Nothing of Row.
     */
    public static final class Nothing implements Row {
        /**
         * Returns null/no cell.
         *
         * @return null
         */
        public List cells() { return null; }
    } // end of class Nothing

    /**
     *
     */
    static final class Untyped implements Row {
        protected final List cells;

        /**
         */
        protected Untyped(final List cells) {
            if (cells == null) {
                throw new IllegalArgumentException();
            }
            
            this.cells = cells;
        }

        /**
         * {@inheritDoc}
         */
        public List cells() { return this.cells; }
    }
} // end of interface Row