BasicObject.java revision 88ce44ccc65e74a8553244ca246cc9f4c48483e0
1/*
2 * Copyright (C) 2015 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 android.databinding.testapp.vo;
18import android.databinding.BaseObservable;
19import android.databinding.Bindable;
20import android.databinding.testapp.BR;
21
22public class BasicObject extends BaseObservable {
23    @Bindable
24    private String mField1;
25    @Bindable
26    private String mField2;
27
28    public String getField1() {
29        return mField1;
30    }
31
32    public void setField1(String field1) {
33        this.mField1 = field1;
34        notifyPropertyChanged(BR.field1);
35    }
36
37    public String getField2() {
38        return mField2;
39    }
40
41    public void setField2(String field2) {
42        this.mField2 = field2;
43        notifyPropertyChanged(BR.field1);
44    }
45
46    @Bindable
47    public boolean isThisNameDoesNotMatchAnythingElse1() {
48        // see: https://code.google.com/p/android/issues/detail?id=190207
49        return false;
50    }
51
52    @Bindable
53    public boolean getThisNameDoesNotMatchAnythingElse2() {
54        return false;
55    }
56
57    public String boolMethod(boolean value) {
58        return value ? "true" : "false";
59    }
60}
61