Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@NotPersistent should be annotated with @Inherited? #216

Closed
fengdai opened this issue Oct 19, 2016 · 1 comment
Closed

@NotPersistent should be annotated with @Inherited? #216

fengdai opened this issue Oct 19, 2016 · 1 comment

Comments

@fengdai
Copy link

fengdai commented Oct 19, 2016

I use auto-value and auto-value-parcel to generate my keys.
Persistent keys which implement Parcelable are totally OK. Like this:

@AutoValue
public abstract class PersistentKey implements Parcelable {
  public static PersistentKey create() {
    return new AutoValue_PersistentKey();
  }
}

My problem is when I define a key which should not be persistent. Like this:

@AutoValue @NotPersistent
public abstract class NotPersistentKey {
  public static NotPersistentKey create() {
    return new AutoValue_NotPersistentKey();
  }
}

As you know, the actual key the application uses is AutoValue_NotPersistentKey which is generated by auto-value and doesn't have @NotPersistent annotation. So Flow throws.

Maybe @NotPersistent should be annotated with @Inherited? Or make it an interface?

@loganj
Copy link
Collaborator

loganj commented Feb 13, 2017

Pretty sure exposing a filtering hook (#220) is more appropriate, and then you can supply your own filtering logic.

@loganj loganj closed this as completed Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants