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

How to get a single element list of strings containing \n ? #269

Open
alexander-poulikakos opened this issue Sep 14, 2020 · 0 comments
Open

Comments

@alexander-poulikakos
Copy link

How to get a single element list of Strings that contains \n from a configuration?

Example code:

	public static void main(String[] args) {
		WithSingleElementList conf = ConfigFactory.create(WithSingleElementList.class);
		List<String> list = conf.getList();
		System.out.println(conf.getList().size()); // Expected to be 1 but is 0
		System.out.println(list);
	}
	
	public static interface WithSingleElementList extends Config {
		@DefaultValue("\n")
		List<String> getList();
	}

Are there any workarounds that would make above code return a one element List, instead of an empty list?

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

1 participant