NotBindableVo.java revision fead9ca09b117136b35bc5bf137340a754f9eddd
1/* 2 * Copyright (C) 2015 The Android Open Source Project 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * http://www.apache.org/licenses/LICENSE-2.0 7 * Unless required by applicable law or agreed to in writing, software 8 * distributed under the License is distributed on an "AS IS" BASIS, 9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 * See the License for the specific language governing permissions and 11 * limitations under the License. 12 */ 13 14package android.databinding.testapp.vo; 15 16public class NotBindableVo { 17 private int mIntValue; 18 private int mIntValueGetCount; 19 private boolean mBoolValue; 20 private int mBoolValueGetCount; 21 private String mStringValue; 22 private int mStringValueGetCount; 23 private final String mFinalString = "this has final content"; 24 public final int publicField = 3; 25 26 public NotBindableVo() { 27 } 28 29 public NotBindableVo(int intValue) { 30 this.mIntValue = intValue; 31 } 32 33 public NotBindableVo(String stringValue) { 34 this.mStringValue = stringValue; 35 } 36 37 public NotBindableVo(int intValue, String stringValue) { 38 this.mIntValue = intValue; 39 this.mStringValue = stringValue; 40 } 41 42 public int getIntValue() { 43 mIntValueGetCount ++; 44 return mIntValue; 45 } 46 47 public String getFinalString() { 48 return mFinalString; 49 } 50 51 public void setIntValue(int intValue) { 52 this.mIntValue = intValue; 53 } 54 55 public String getStringValue() { 56 mStringValueGetCount ++; 57 return mStringValue; 58 } 59 60 public void setStringValue(String stringValue) { 61 this.mStringValue = stringValue; 62 } 63 64 public String mergeStringFields(NotBindableVo other) { 65 return mStringValue + (other == null ? "" : other.mStringValue); 66 } 67 68 public boolean getBoolValue() { 69 mBoolValueGetCount ++; 70 return mBoolValue; 71 } 72 73 public void setBoolValue(boolean boolValue) { 74 mBoolValue = boolValue; 75 } 76 77 public int getIntValueGetCount() { 78 return mIntValueGetCount; 79 } 80 81 public int getBoolValueGetCount() { 82 return mBoolValueGetCount; 83 } 84 85 public int getStringValueGetCount() { 86 return mStringValueGetCount; 87 } 88} 89