1010import org .springframework .data .domain .Page ;
1111import org .springframework .data .domain .PageRequest ;
1212import org .springframework .data .domain .Sort ;
13+ import org .springframework .lang .Nullable ;
1314
1415import java .time .OffsetDateTime ;
1516import java .util .Collection ;
@@ -23,13 +24,13 @@ public class QueryEmail {
2324 private final EmailMapper emailMapper ;
2425 private final EntityManager entityManager ;
2526
26- public Page <EmailDto > paginatedByState (final EmailState state , final PageRequest pageParameter ) {
27+ public Page <EmailDto > paginatedByState (EmailState state , PageRequest pageParameter ) {
2728 var pageRequest = PageRequest .of (pageParameter .getPageNumber (), pageParameter .getPageSize (), Sort .by ("updatedAt" ));
2829
2930 return emailMapper .toDto (emailRepository .findByState (state , pageRequest ));
3031 }
3132
32- public List <EmailDto > byIds (final Collection <Long > ids ) {
33+ public List <EmailDto > byIds (Collection <Long > ids ) {
3334 if (ids .isEmpty ()) {
3435 return Collections .emptyList ();
3536 }
@@ -49,11 +50,11 @@ List<Email> readyToSend() {
4950 .getResultList ();
5051 }
5152
52- public Optional <EmailDto > byId (final long id ) {
53+ public Optional <EmailDto > byId (long id ) {
5354 return emailRepository .findById (id ).map (emailMapper ::toDto );
5455 }
5556
56- public List <EmailDto > byReference (final String reference ) {
57+ public List <EmailDto > byReference (@ Nullable String reference ) {
5758 return emailMapper .toDto (emailRepository .findByReference (reference ));
5859 }
5960}
0 commit comments