package io.dwak.androidtracker.viewmodel;

import io.dwak.tracker.ReactorDependency;

/**
 * Created by vishnu on 12/23/14.
 */
public class FavoriteFoodViewModel {
    public static String PIZZA = "PIZZA";
    public static String MANGOES = "MANGOES";
    private boolean mIsPizza;
    private String mFavoriteFood;
    private int mFavoritePercentage;

    private String mEditTextValue;
    private ReactorDependency mIsPizzaDep;
    private ReactorDependency mFavoriteFoodDep;
    private ReactorDependency mFavoritePercentageDep;
    private ReactorDependency mEditTextValueDep;

    public FavoriteFoodViewModel(String favoriteFood, int favoritePercentage) {
        mIsPizzaDep = new ReactorDependency();
        mFavoriteFoodDep = new ReactorDependency();
        mFavoritePercentageDep = new ReactorDependency();
        mEditTextValueDep = new ReactorDependency();
        mIsPizza = PIZZA.equals(favoriteFood);
        mFavoriteFood = favoriteFood;
        mFavoritePercentage = favoritePercentage;
        mEditTextValue = "";
    }

    public int getFavoritePercentage() {
        mFavoritePercentageDep.depend();
        return mFavoritePercentage;
    }

    public void setFavoritePercentage(int favoritePercentage) {
        mFavoritePercentage = favoritePercentage;
        mFavoritePercentageDep.changed();
    }

    public String getFavoriteFood() {
        mFavoriteFoodDep.depend();
        return mFavoriteFood;
    }

    public void setFavoriteFood(String favoriteFood) {
        mFavoriteFood = favoriteFood;
        mFavoriteFoodDep.changed();
    }

    public boolean isPizza() {
        mIsPizzaDep.depend();
        return mIsPizza;
    }

    public void setPizza(boolean isPizza) {
        mIsPizza = isPizza;
        mIsPizzaDep.changed();
    }

    public String getEditTextValue() {
        mEditTextValueDep.depend();
        return mEditTextValue;
    }

    public void setEditTextValue(String editTextValue) {
        mEditTextValue = editTextValue;
        mEditTextValueDep.changed();
    }
}

@@ -347,17 +347,16 @@
 entage;%0A
-%0A
     priv
@@ -423,29 +423,22 @@
 PizzaDep
-;%0A    private
+ = new
  Reactor
@@ -447,33 +447,18 @@
 pendency
- mFavoriteFoodDep
+()
 ;%0A    pr
@@ -494,278 +494,166 @@
 rite
-PercentageDep;%0A    private ReactorDependency mEditTextValueDep
+FoodDep = new ReactorDependency()
 ;%0A
-%0A
     p
-ublic FavoriteFoodViewModel(String favoriteFood, int favoritePercentage) %7B%0A        mIsPizzaDep = new ReactorDependency();%0A        mFavoriteFoodDep = new ReactorDependency();%0A        mFavoritePercentag
+rivate ReactorDependency mFavoritePercentageDep = new ReactorDependency();%0A    private ReactorDependency mEditTextValu
 eDep
@@ -684,60 +684,88 @@
 ();%0A
+%0A
     
-    mEditTextValueDep = new ReactorDependency();
+public FavoriteFoodViewModel(String favoriteFood, int favoritePercentage) %7B
 %0A   
@@ -947,65 +947,44 @@
 lic 
-int getFavoritePercentage() %7B%0A        mFavoritePercentage
+boolean isPizza() %7B%0A        mIsPizza
 Dep.
@@ -1009,34 +1009,23 @@
 return m
-FavoritePercentage
+IsPizza
 ;%0A    %7D%0A
@@ -1048,130 +1048,84 @@
  set
-FavoritePercentage(int favoritePercentage) %7B%0A        mFavoritePercentage = favoritePercentage;%0A        mFavoritePercentage
+IsPizza(boolean isPizza) %7B%0A        this.mIsPizza = isPizza;%0A        mIsPizza
 Dep.
@@ -1307,32 +1307,37 @@
 Food) %7B%0A        
+this.
 mFavoriteFood = 
@@ -1408,44 +1408,65 @@
 lic 
-boolean isPizza() %7B%0A        mIsPizza
+int getFavoritePercentage() %7B%0A        mFavoritePercentage
 Dep.
@@ -1483,39 +1483,50 @@
         return m
-IsPizza
+FavoritePercentage
 ;%0A    %7D%0A%0A    pub
@@ -1541,77 +1541,135 @@
  set
-Pizza(boolean isPizza) %7B%0A        mIsPizza = isPizza;%0A        mIsPizza
+FavoritePercentage(int favoritePercentage) %7B%0A        this.mFavoritePercentage = favoritePercentage;%0A        mFavoritePercentage
 Dep.
@@ -1856,32 +1856,37 @@
 alue) %7B%0A        
+this.
 mEditTextValue =

update with code generated from updated plugin