Home | History | Annotate | Download | only in vo
      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 
     14 package android.databinding.testapp.vo;
     15 
     16 import android.view.View;
     17 
     18 import java.util.concurrent.atomic.AtomicInteger;
     19 
     20 public class NotBindableVo {
     21     public static int STATIC_VAL = 101;
     22     private int mIntValue;
     23     private int mIntValueGetCount;
     24     private boolean mBoolValue;
     25     private int mBoolValueGetCount;
     26     private String mStringValue;
     27     private int mStringValueGetCount;
     28     private final String mFinalString = "this has final content";
     29     public final int publicField = 3;
     30     public static AtomicInteger sStaticCounter = new AtomicInteger();
     31 
     32     public NotBindableVo() {
     33     }
     34 
     35     public NotBindableVo(int intValue) {
     36         this.mIntValue = intValue;
     37     }
     38 
     39     public NotBindableVo(String stringValue) {
     40         this.mStringValue = stringValue;
     41     }
     42 
     43     public NotBindableVo(int intValue, String stringValue) {
     44         this.mIntValue = intValue;
     45         this.mStringValue = stringValue;
     46     }
     47 
     48     public int getIntValue() {
     49         mIntValueGetCount ++;
     50         return mIntValue;
     51     }
     52 
     53     public String getFinalString() {
     54         return mFinalString;
     55     }
     56 
     57     public void setIntValue(int intValue) {
     58         this.mIntValue = intValue;
     59     }
     60 
     61     public String getStringValue() {
     62         mStringValueGetCount ++;
     63         return mStringValue;
     64     }
     65 
     66     public void setStringValue(String stringValue) {
     67         this.mStringValue = stringValue;
     68     }
     69 
     70     public String mergeStringFields(NotBindableVo other) {
     71         return mStringValue + (other == null ? "" : other.mStringValue);
     72     }
     73 
     74     public boolean getBoolValue() {
     75         mBoolValueGetCount ++;
     76         return mBoolValue;
     77     }
     78 
     79     public void setBoolValue(boolean boolValue) {
     80         mBoolValue = boolValue;
     81     }
     82 
     83     public int getIntValueGetCount() {
     84         return mIntValueGetCount;
     85     }
     86 
     87     public int getBoolValueGetCount() {
     88         return mBoolValueGetCount;
     89     }
     90 
     91     public int getStringValueGetCount() {
     92         return mStringValueGetCount;
     93     }
     94 
     95     public static boolean incStaticCounter() {
     96         sStaticCounter.incrementAndGet();
     97         return true;
     98     }
     99 }
    100