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

Add abstract delegate converter class #366

Merged
merged 2 commits into from
Nov 13, 2019
Merged

Add abstract delegate converter class #366

merged 2 commits into from
Nov 13, 2019

Conversation

imagejan
Copy link
Member

@imagejan imagejan commented Nov 8, 2019

This PR closes #182 and adds AbstractDelegateConverter that allows to specify new converters that chain together two subsequent conversions like this:

@Plugin(type = Converter.class)
public class StringToDatasetConverter extends
	AbstractDelegateConverter<String, File, Dataset>
{

	@Override
	public Class<Dataset> getOutputType() {
		return Dataset.class;
	}

	@Override
	public Class<String> getInputType() {
		return String.class;
	}

	@Override
	protected Class<File> getDelegateType() {
		return File.class;
	}
}

I am not sure about how to implement the test: is it possible to create private nested classes that can be discovered as Plugins during test time?

I'd appreciate some advice here if you have time, @ctrueden.

EDIT: I think I figured it out. I force-pushed the latest commit, adding a test for the abstract class. This should now be ready for review.

Test coverage of the added classes: 100% 🙂

@imagejan imagejan marked this pull request as ready for review November 8, 2019 09:17
@ctrueden
Copy link
Member

Cool, thanks a lot @imagejan!

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

Successfully merging this pull request may close these issues.

Create delegate converter abstract class
2 participants