// Path: app/src/main/java/gdg/devfest/passwordmanager/model/CustomField.java
// public class CustomField extends RealmObject {
//   private String name;
//   private String value;
// 
//   public CustomField() {}
// 
//   public CustomField(String name, String value) {
//     this.name = name;
//     this.value = value;
//   }
// 
//   public String getName() {
//     return name;
//   }
// 
//   public void setName(String name) {
//     this.name = name;
//   }
// 
//   public String getValue() {
//     return value;
//   }
// 
//   public void setValue(String value) {
//     this.value = value;
//   }
// }


import android.databinding.ObservableField;
import gdg.devfest.passwordmanager.model.CustomField;
import java.util.ArrayList;
import java.util.List;
package gdg.devfest.passwordmanager.viewmodel;


public class CustomFieldViewModel implements ViewModel {
  public final ObservableField<String> name;
  public final ObservableField<String> value;

  private final OnUpdateListener updateListener;

  CustomFieldViewModel(String name, String value, OnUpdateListener updateListener) {
    this.name = new ObservableField<>(name);
    this.value = new ObservableField<>(value);
    this.updateListener = updateListener;
  }

  public void update() {
    if (updateListener != null) updateListener.update(this);
  }

// Path: app/src/main/java/gdg/devfest/passwordmanager/model/CustomField.java
// public class CustomField extends RealmObject {
//   private String name;
//   private String value;
// 
//   public CustomField() {}
// 
//   public CustomField(String name, String value) {
//     this.name = name;
//     this.value = value;
//   }
// 
//   public String getName() {
//     return name;
//   }
// 
//   public void setName(String name) {
//     this.name = name;
//   }
// 
//   public String getValue() {
//     return value;
//   }
// 
//   public void setValue(String value) {
//     this.value = value;
//   }
// }


// Path: app/src/main/java/gdg/devfest/passwordmanager/viewmodel/CustomFieldViewModel.java
import android.databinding.ObservableField;
import gdg.devfest.passwordmanager.model.CustomField;
import java.util.ArrayList;
import java.util.List;

package gdg.devfest.passwordmanager.viewmodel;


public class CustomFieldViewModel implements ViewModel {
  public final ObservableField<String> name;
  public final ObservableField<String> value;

  private final OnUpdateListener updateListener;

  CustomFieldViewModel(String name, String value, OnUpdateListener updateListener) {
    this.name = new ObservableField<>(name);
    this.value = new ObservableField<>(value);
    this.updateListener = updateListener;
  }

  public void update() {
    if (updateListener != null) updateListener.update(this);
  }

  public static CustomFieldViewModel of(CustomField customField, OnUpdateListener updateListener) {