Implement rules for automatic value unwrapping

Description

The rules have been discussed here.

 

Validator exists for wrapper

Validator exists for wrapped value

Unwrapper exists

Example

Desirable result

1

--

--

--

--

Declaration error

2

--

--

x

@Future Optional<Integer> myInt;

Declaration error

3

--

x

--

@Min(3) Holder<Integer> myHolder;

Declaration error

4

--

x

x

@Min(3) Optional<nteger> myInt; Optional<@Email String>;

Validate wrapped value

5

x

--

--

@ValidHolder Holder myHolder;

Validate wrapper

6

x

--

x

@ValidHolder Holder myHolder;

Validate wrapper

7

x

x

--

@NotNull Holder myHolder;

Validate wrapper

8

x

x

x

@NotNull IntegerProperty myInt;

Declaration error; needs to be resolved by making intent explicit (which could be achieved by adding a boolean flag to @UnwrapValidatedValue)

Environment

None

Assignee

Hardy Ferentschik

Reporter

Hardy Ferentschik

Labels

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major
Configure