title: Using an interface with Firebase
body: <p>Currently I am implementing an interface called RowType for a handful of different classes let's say class A, B, and C. How would I iterate through Firebase to get each different object? </p>
  
  <pre><code>.addListenerForSingleValueEvent(new ValueEventListener() {
                  @Override
                  public void onDataChange(DataSnapshot dataSnapshot) {
                      for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                          RowType rowType = snapshot.getValue(RowType.class);
                          Log.d("awdjk", "qwjel");
                      }
  </code></pre>
  
  <p>I would assume that since all the objects inserted in Firebase are of either class A, B, or C, that I could use RowType to get the snapshot value. However, I am getting an error saying that "No properties to serialize found on class RowType".</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Interface</p>
  
  <pre><code>public interface RowType {
  int EXERCISE_ROW = 0;
  int REST_ROW = 1;
  int SUPERSET_ROW = 2;
  int PYRAMIDSET_ROW = 3;
  int BUTTON_ROW = 4;
  }
  </code></pre>
  
  <p>Exercise class</p>
  
  <pre><code>public class ExerciseModel implements RowType {
  public String exercise, sets, reps, view, minutes, seconds, time, weight, childCount;
  private EditText weightEditText, setsEditText, repsEditText;
  private AutoCompleteTextView exerciseEditText;
  private ImageView dragHandle;
  private ExerciseRowTextWatcher exerciseRowTextWatcher;
  
  
  public ExerciseRowTextWatcher getExerciseRowTextWatcher(){
      return exerciseRowTextWatcher;
  }
  
  public void setExerciseRowTextWatcher(ExerciseRowTextWatcher exerciseRowTextWatcher){
      this.exerciseRowTextWatcher = exerciseRowTextWatcher;
  }
  
  
  public ImageView getDragHandle(){
      return dragHandle;
  }
  
  public void setDragHandle(ImageView dragHandle){
      this.dragHandle = dragHandle;
  }
  
  public AutoCompleteTextView getExerciseEditText(){
      return exerciseEditText;
  }
  
  public void setExerciseEditText(AutoCompleteTextView exerciseEditText){
      this.exerciseEditText = exerciseEditText;
  }
  
  public EditText getWeightEditText(){
      return weightEditText;
  }
  
  public void setWeightEditText(EditText weightEditText){
      this.weightEditText = weightEditText;
  }
  
  public EditText getSetsEditText(){
      return setsEditText;
  }
  
  public void setSetsEditText(EditText setsEditText){
      this.setsEditText = setsEditText;
  }
  
  public EditText getRepsEditText(){
      return repsEditText;
  }
  
  public void setRepsEditText(EditText repsEditText){
      this.repsEditText = repsEditText;
  }
  
  public String getChildCount(){
      return childCount;
  }
  
  public void setChildCount(String childCount){
      this.childCount = childCount;
  }
  
  public String getExercise(){
      return exercise;
  }
  
  public String getWeight(){
      return weight;
  }
  
  public String getSets(){
      return sets;
  }
  
  public String getReps(){
      return reps;
  }
  
  public String getView(){
      return view;
  }
  
  public String getMinutes(){
      return minutes;
  }
  
  public String getSeconds(){
      return seconds;
  }
  
  public String getTime(){   return time;}
  
  public void setExercise(String exercise){
      this.exercise = exercise;
  }
  
  public void setTime(String time){ this.time = time; }
  
  public void setWeight(String weight){
      this.weight = weight;
  }
  
  public void setMinutes(String minutes){
      this.minutes = minutes;
  }
  
  public void setSeconds(String seconds){
      this.seconds = seconds;
  }
  
  public void setSets(String sets){
      this.sets = sets;
  }
  
  public void setView(String view){
      this.view = view;
  }
  
  public void setReps(String reps){
      this.reps = reps;
  }
  
  }
  </code></pre>
  
  <p>I have other classes that are implemented in the interface, but to keep this short, I have added only the exercise class. The other classes are relatively similar.</p>