Johnny
Johnny

Reputation: 15

RealmObject And Implement Interface

When I applied Realm in my object. It look Like that: public class Attribute extends RealmObject implements Parcelable, BaseEntity {}

Give me this error: error: Only getters and setters should be defined in RealmObject classes

Who can give me the resons and solution. BIG THANKS. Please help me !

Upvotes: 0

Views: 1029

Answers (1)

Christian Melchior
Christian Melchior

Reputation: 20126

Currently RealmObjects does not support implementing Parcable, and interfaces are only supported if they are empty or contain the getters and setter methods you would otherwise generate.

For Parcable you can consider using Parceler: https://realm.io/docs/java/latest/#parceler

Otherwise we are tracking the issue here: https://github.com/realm/realm-java/issues/878

Supporting interfaces in general will be possible once we implement support for custom methods, that can be tracked here: https://github.com/realm/realm-java/issues/909

Upvotes: 1

Related Questions