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

Allow the use of generic type with Interface #149

Merged
merged 2 commits into from
Sep 24, 2019
Merged

Allow the use of generic type with Interface #149

merged 2 commits into from
Sep 24, 2019

Conversation

Valitutto
Copy link
Contributor

I created an interface with the methods to get the default fields of the event class and implemented it.
I then changed each occurrence of Event class with T class that extends the interface.

This will allow us to make the plugin work with any custom class (as I already do in some of my projects).

Of course with the default Event class it will continue to work because it implements EventInterface.

created EventInterface with methods: DateTime getDate()
String getTitle()
Widget getIcon()
Widget getDot()

Overrided method in class Event, now implements EventInterface
replaced all class Event with T
now we can use any class that implements the interface
@Valitutto Valitutto changed the title Allow the use of any class with Interface Allow the use of generic type with Interface Sep 23, 2019
@hyochan hyochan added enhancement New feature or request feature labels Sep 24, 2019
@hyochan
Copy link
Owner

hyochan commented Sep 24, 2019

Resolve #151

@hyochan hyochan merged commit 0d61cc1 into hyochan:master Sep 24, 2019
@Valitutto Valitutto deleted the t-extends-event branch October 15, 2019 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants