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 */
16package android.databinding.testapp.vo;
17
18import android.databinding.BaseObservable;
19import android.databinding.ObservableField;
20import android.databinding.testapp.BR;
21import android.util.ArrayMap;
22
23import java.util.ArrayList;
24import java.util.List;
25import java.util.Map;
26
27public class FindMethodBindingObject extends FindMethodBindingObjectBase {
28    public String method() { return "no arg"; }
29
30    public String method(int i) { return String.valueOf(i); }
31
32    public String method(float f) { return String.valueOf(f); }
33
34    public String method(String value) { return value; }
35
36    public static String staticMethod() { return "world"; }
37
38    public static Foo foo = new Foo();
39
40    public ObservableClass observableClass = new ObservableClass();
41
42    public static Bar<String> bar = new Bar<>();
43
44    public float confusingParam(int i) { return i; }
45    public String confusingParam(Object o) { return o.toString(); }
46
47    public int confusingPrimitive(int i) { return i; }
48    public String confusingPrimitive(Integer i) { return i.toString(); }
49
50    public float confusingInheritance(Object o) { return 0; }
51    public String confusingInheritance(String s) { return s; }
52    public int confusingInheritance(Integer i) { return i; }
53
54    public int confusingTypeArgs(List<String> s) { return 0; }
55    public String confusingTypeArgs(Map<String, String> s) { return "yay"; }
56
57    public ArrayMap<String, String> getMap() { return null; }
58
59    public int[] getArray() { return new int[5]; }
60
61    public final ObservableField<String> myField = new ObservableField<String>();
62
63    public List getList() {
64        ArrayList<String> vals = new ArrayList<>();
65        vals.add("hello");
66        return vals;
67    }
68
69    public int argsClose(int i, String j) {
70        return i;
71    }
72
73    public float argsClose(int i, short j) {
74        return i;
75    }
76
77    public int argsClose(int i, int j) {
78        return j;
79    }
80
81    public static class Foo {
82        public final String bar = "hello world";
83        public static final String baz = "hello world";
84    }
85
86    public static class Bar<T> {
87        public T method(T value) { return value; }
88    }
89
90    public static final class ObservableClass extends BaseObservable {
91        public String x;
92
93        public String getX() {
94            return x;
95        }
96
97        public void setX(String x) {
98            this.x = x;
99            notifyPropertyChanged(BR._all);
100        }
101    }
102}
103