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

OpenPojo should support JDK record objects. #151

Open
scottresnik opened this issue Jan 10, 2024 · 0 comments
Open

OpenPojo should support JDK record objects. #151

scottresnik opened this issue Jan 10, 2024 · 0 comments

Comments

@scottresnik
Copy link

With the following validator:

		Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new SetterMustExistRule())
				.with(new SetterTester()).with(new GetterTester()).build();
		validator.validate(PojoClassFactory.getPojoClasses(getClass().getPackageName()));

This class passes:

public class SimpleClass {
	private final String message;
	private final List<String> values;

	public SimpleClass(String message, List<String> values) {
		this.message = message;
		this.values = values;
	}

	public String getMessage() {
		return message;
	}

	public List<String> getValues() {
		return values;
	}
}

This similar record fails:

public record SimpleRecord(String message, List<String> values){}

A simple workaround is the following filter: pojoClass -> !pojoClass.getClazz().isRecord() .

It would be nice to have an isRecord() method on the PojoClass interface as well.

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