1b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar/* 2b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * Copyright (C) 2017 The Android Open Source Project 3b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * 4b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * Licensed under the Apache License, Version 2.0 (the "License"); 5b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * you may not use this file except in compliance with the License. 6b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * You may obtain a copy of the License at 7b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * 8b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * http://www.apache.org/licenses/LICENSE-2.0 9b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * 10b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * Unless required by applicable law or agreed to in writing, software 11b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * distributed under the License is distributed on an "AS IS" BASIS, 12b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * See the License for the specific language governing permissions and 14b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * limitations under the License. 15b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar */ 16b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 17bdc4c86d3dff74f6634a38e2f7b316b0e823a2c8Alan Viverettepackage androidx.sqlite.db.framework; 18b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 19b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyarimport android.database.sqlite.SQLiteProgram; 20bdc4c86d3dff74f6634a38e2f7b316b0e823a2c8Alan Viverette 21bdc4c86d3dff74f6634a38e2f7b316b0e823a2c8Alan Viveretteimport androidx.sqlite.db.SupportSQLiteProgram; 22b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 23b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar/** 24b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar * An wrapper around {@link SQLiteProgram} to implement {@link SupportSQLiteProgram} API. 25b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar */ 26b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyarclass FrameworkSQLiteProgram implements SupportSQLiteProgram { 27e185ed6ba937bdc218104c18d2615e1ce524adb7Yigit Boyar private final SQLiteProgram mDelegate; 2864db0cc15b78b62a1d44a70fc8b4552e660d952cYigit Boyar 29b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar FrameworkSQLiteProgram(SQLiteProgram delegate) { 30b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar mDelegate = delegate; 31b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar } 32b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 33b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar @Override 34b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar public void bindNull(int index) { 35b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar mDelegate.bindNull(index); 36b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar } 37b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 38b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar @Override 39b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar public void bindLong(int index, long value) { 40b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar mDelegate.bindLong(index, value); 41b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar } 42b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 43b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar @Override 44b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar public void bindDouble(int index, double value) { 45b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar mDelegate.bindDouble(index, value); 46b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar } 47b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 48b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar @Override 49b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar public void bindString(int index, String value) { 50b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar mDelegate.bindString(index, value); 51b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar } 52b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 53b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar @Override 54b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar public void bindBlob(int index, byte[] value) { 55b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar mDelegate.bindBlob(index, value); 56b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar } 57b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar 58b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar @Override 59b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar public void clearBindings() { 60b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar mDelegate.clearBindings(); 61b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar } 620d1b036f6868844705cd3b57e96d373edd09b3d5Yigit Boyar 630d1b036f6868844705cd3b57e96d373edd09b3d5Yigit Boyar @Override 6473f1e89d7b93690caf68c7350c56e424e4c73343Jake Wharton public void close() { 650d1b036f6868844705cd3b57e96d373edd09b3d5Yigit Boyar mDelegate.close(); 660d1b036f6868844705cd3b57e96d373edd09b3d5Yigit Boyar } 67b030dcb5b7a62854c0bfe85bf04eaf60caeb83bbYigit Boyar} 68