FindMethodBindingObject.java revision d33691a5725244f1bb5c4491af81b9fc67e0f39f
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.util.ArrayMap;
19
20import java.util.ArrayList;
21import java.util.List;
22import java.util.Map;
23
24public class FindMethodBindingObject extends FindMethodBindingObjectBase {
25    public String method() { return "no arg"; }
26
27    public String method(int i) { return String.valueOf(i); }
28
29    public String method(float f) { return String.valueOf(f); }
30
31    public String method(String value) { return value; }
32
33    public static String staticMethod() { return "world"; }
34
35    public static Foo foo = new Foo();
36
37    public static Bar<String> bar = new Bar<>();
38
39    public float confusingParam(int i) { return i; }
40    public String confusingParam(Object o) { return o.toString(); }
41
42    public int confusingPrimitive(int i) { return i; }
43    public String confusingPrimitive(Integer i) { return i.toString(); }
44
45    public float confusingInheritance(Object o) { return 0; }
46    public String confusingInheritance(String s) { return s; }
47    public int confusingInheritance(Integer i) { return i; }
48
49    public int confusingTypeArgs(List<String> s) { return 0; }
50    public String confusingTypeArgs(Map<String, String> s) { return "yay"; }
51
52    public ArrayMap<String, String> getMap() { return null; }
53
54    public int[] getArray() { return new int[5]; }
55
56    public List getList() {
57        ArrayList<String> vals = new ArrayList<>();
58        vals.add("hello");
59        return vals;
60    }
61
62    public static class Foo {
63        public final String bar = "hello world";
64        public static final String baz = "hello world";
65    }
66
67    public static class Bar<T> {
68        public T method(T value) { return value; }
69    }
70}
71