Git Product home page Git Product logo

Comments (6)

johncarl81 avatar johncarl81 commented on August 10, 2024

We, at least, should have a better error message. What does your bean look like that gives this exception?

from parceler.

tom91136 avatar tom91136 commented on August 10, 2024

Sorry I forgot this issue...
I'm using parceler to pass an ArrayList<objects annotated with @Parcel> using Bundle so there's no beans involved...(I might be abusing parceler though)

from parceler.

johncarl81 avatar johncarl81 commented on August 10, 2024

Oh, I see.. so you're doing the following:

Parceler.wrap(Collections.unmodifiableList(...));

I wouldn't call this an abuse... For performance reasons the Parcels utility class uses only the direct class to lookup the associated parceler factory class. Yes, these both are Lists, but they are different un-mapped types.

If we open up the pre-defined Parcelable types (change modifier from private to public) you could avoid using the Parceler.wrap() method and use the Parcelable directly:

new NonParcelRepository.ListParcelable(Collection.unmodifiableList()); //equivalent

Or maybe we could add another wrap method with a secondary parameter to solidify which Parcelable to use:

Parceler.wrap(List.class, Collections.unmodifiableList(...));

Thoughts?

from parceler.

tom91136 avatar tom91136 commented on August 10, 2024

Yeah, that would work. I was thinking about dropping the Class parameter but thanks to type erasure, this is probably the only thing we can do....

from parceler.

johncarl81 avatar johncarl81 commented on August 10, 2024

Done (78243d8). I also added your examples as part of the testing suite. Give it a whirl under version 0.2.13-SNAPSHOT.

from parceler.

tom91136 avatar tom91136 commented on August 10, 2024

Perfect!

from parceler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.