1/*
2 * Copyright (C) 2017 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
17package androidx.sqlite.db.framework;
18
19import android.database.sqlite.SQLiteProgram;
20
21import androidx.sqlite.db.SupportSQLiteProgram;
22
23/**
24 * An wrapper around {@link SQLiteProgram} to implement {@link SupportSQLiteProgram} API.
25 */
26class FrameworkSQLiteProgram implements SupportSQLiteProgram {
27    private final SQLiteProgram mDelegate;
28
29    FrameworkSQLiteProgram(SQLiteProgram delegate) {
30        mDelegate = delegate;
31    }
32
33    @Override
34    public void bindNull(int index) {
35        mDelegate.bindNull(index);
36    }
37
38    @Override
39    public void bindLong(int index, long value) {
40        mDelegate.bindLong(index, value);
41    }
42
43    @Override
44    public void bindDouble(int index, double value) {
45        mDelegate.bindDouble(index, value);
46    }
47
48    @Override
49    public void bindString(int index, String value) {
50        mDelegate.bindString(index, value);
51    }
52
53    @Override
54    public void bindBlob(int index, byte[] value) {
55        mDelegate.bindBlob(index, value);
56    }
57
58    @Override
59    public void clearBindings() {
60        mDelegate.clearBindings();
61    }
62
63    @Override
64    public void close() {
65        mDelegate.close();
66    }
67}
68