There is an object:
public class Contact extends RealmObject implements Serializable { @PrimaryKey private String id; private String displayName; private RealmList<Phone> phone; private RealmList<Email> email; private RealmList<Note> notes; private RealmList<Address> addresses = new RealmList<Address>(); private RealmList<IM> imAddresses; private Organization organization; private int status = -1; private String photo; }
For example, I have a phone number that is stored in the Phone
object and the one in the RealmList<Phone> phone
list.
The Phone
object looks like this:
public class Phone extends RealmObject implements Serializable { private String number; private String type; public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getType() { return type; } public void setType(String type) { this.type = type; } }
Question: how can I get the object itself by the phone number that is contained in the Phone
in the private String number
field.