title: How to use class as parameter (for Realm, for Retrofit, etc.)?
body: <p>This is standard realm query:</p>
  
  <pre><code>private void doQuery() {
      RealmResults&lt;User&gt; result = realm.where(User.class)
              .equalTo("name", "John")
              .or()
              .equalTo("name", "Peter")
              .findAll();
  }
  </code></pre>
  
  <p>I would like to use this as function with parameter, meaning <strong>User &amp; User.class</strong> wouldn´t not be hardcoded, it would be provided as parameter. Something like this, but this is wrong. Please advice how to do that.</p>
  
  <p><strong>EDIT: It seems that problem with "User.class" is solved, but "User" remains.</strong></p>
  
  <pre><code>private void doQuery(Class&lt;? extends RealmObject&gt; realmClass) {
      RealmResults&lt;realmObject&gt; result = realm.where(realmClass)
              .equalTo("name", "John")
              .or()
              .equalTo("name", "Peter")
              .findAll();
  }
  </code></pre>
  
  <p><strong>EDIT: When you give me minus, please be so kind and explain why.</strong></p>
  
  <p>Thank you.</p>