import java.util.List;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Data
public class SampleRequest {
List<@NotNull String> list;
}
アノテーションを自作する場合は ElementType.TYPE_USE
を使用する。
@Target(java.lang.annotation.ElementType.TYPE_USE)