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

[WIP] [V3] New ModelAdapter #482

Merged
merged 4 commits into from
Jul 16, 2017
Merged

Conversation

FabianTerhorst
Copy link
Contributor

@FabianTerhorst FabianTerhorst commented Jul 16, 2017

  • Add an IdDistributor interface to make id distribution to each item flexible and extendable. This change also stores the id distributor instance to the item adapter. The default implementation is stored static inside the interface so the atomic long is shared with all item adapters to not collide with an second item adapter instance.
    When you want to make an own implementation that depends on an id increasement you have to share the implementation to all item adapters or make the id static.

mikepenz and others added 2 commits July 15, 2017 22:48
* adjust all methods and add additional internal methods (which need to be implemented in the IItemAdapter)
Add an IdDistributor interface to make id distribution to each item flexible and extendable. This change also stores the id distributor instance to the item adapter. The default implementation is stored static inside the interface so the atomic long is shared with all item adapters to not collicate with an second item adapter instance.
return item;
}
});
super((IInterceptor<Item, Item>) IInterceptor.DEFAULT);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static generic doesnt work, not sure about an other way without an cast.


public IIdDistributor<Item> getIdDistributor() {
if (mIdDistributor == null) {
return (IIdDistributor<Item>) IIdDistributor.DEFAULT;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static generic doesnt work, not sure about an other way without an cast.

@FabianTerhorst FabianTerhorst requested a review from mikepenz July 16, 2017 00:33
@FabianTerhorst FabianTerhorst added this to the v3.0.0 milestone Jul 16, 2017
@FabianTerhorst FabianTerhorst changed the title Feature/v3 new modeladapter [WIP] [V3] New ModelAdapter Jul 16, 2017
@mikepenz mikepenz merged commit a4ab5c4 into feature/v3_new Jul 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants