Home | History | Annotate | Download | only in db
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package androidx.sqlite.db;
     18 
     19 import java.io.Closeable;
     20 
     21 /**
     22  * An interface to map the behavior of {@link android.database.sqlite.SQLiteProgram}.
     23  */
     24 
     25 @SuppressWarnings("unused")
     26 public interface SupportSQLiteProgram extends Closeable {
     27     /**
     28      * Bind a NULL value to this statement. The value remains bound until
     29      * {@link #clearBindings} is called.
     30      *
     31      * @param index The 1-based index to the parameter to bind null to
     32      */
     33     void bindNull(int index);
     34 
     35     /**
     36      * Bind a long value to this statement. The value remains bound until
     37      * {@link #clearBindings} is called.
     38      *addToBindArgs
     39      * @param index The 1-based index to the parameter to bind
     40      * @param value The value to bind
     41      */
     42     void bindLong(int index, long value);
     43 
     44     /**
     45      * Bind a double value to this statement. The value remains bound until
     46      * {@link #clearBindings} is called.
     47      *
     48      * @param index The 1-based index to the parameter to bind
     49      * @param value The value to bind
     50      */
     51     void bindDouble(int index, double value);
     52 
     53     /**
     54      * Bind a String value to this statement. The value remains bound until
     55      * {@link #clearBindings} is called.
     56      *
     57      * @param index The 1-based index to the parameter to bind
     58      * @param value The value to bind, must not be null
     59      */
     60     void bindString(int index, String value);
     61 
     62     /**
     63      * Bind a byte array value to this statement. The value remains bound until
     64      * {@link #clearBindings} is called.
     65      *
     66      * @param index The 1-based index to the parameter to bind
     67      * @param value The value to bind, must not be null
     68      */
     69     void bindBlob(int index, byte[] value);
     70 
     71     /**
     72      * Clears all existing bindings. Unset bindings are treated as NULL.
     73      */
     74     void clearBindings();
     75 }
     76