@Override
  public BubbleEntry buildEntryFromResultObject(T realmObject, int xIndex) {
    DynamicRealmObject dynamicObject = new DynamicRealmObject(realmObject);

    return new BubbleEntry(
        mIndexField == null ? xIndex : dynamicObject.getInt(mIndexField),
        dynamicObject.getFloat(mValuesField),
        dynamicObject.getFloat(mSizeField));
  }
  @Override
  public void build(RealmResults<T> results) {

    if (mIndexField == null) { // x-index not available

      int xIndex = 0;

      for (T object : results) {

        DynamicRealmObject dynamicObject = new DynamicRealmObject(object);
        mValues.add(new Entry(dynamicObject.getFloat(mValuesField), xIndex));
        xIndex++;
      }

    } else {

      for (T object : results) {

        DynamicRealmObject dynamicObject = new DynamicRealmObject(object);
        mValues.add(
            new Entry(dynamicObject.getFloat(mValuesField), dynamicObject.getInt(mIndexField)));
      }
    }
  }
  public CandleEntry buildEntryFromResultObject(T realmObject, int xIndex) {
    DynamicRealmObject dynamicObject = new DynamicRealmObject(realmObject);

    return new CandleEntry(
        mIndexField == null ? xIndex : dynamicObject.getInt(mIndexField),
        dynamicObject.getFloat(mHighField),
        dynamicObject.getFloat(mLowField),
        dynamicObject.getFloat(mOpenField),
        dynamicObject.getFloat(mCloseField));
  }