- 
                Notifications
    You must be signed in to change notification settings 
- Fork 699
          Refine parameter and field names to align with PageRequest property names
          #2882
        
          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
          
     Closed
      
      
            thachlp
  wants to merge
  1
  commit into
  spring-projects:main
from
thachlp:improve-consistence-parameters
  
      
      
   
      
    
  
     Closed
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -26,6 +26,7 @@ | |
| * @author Thomas Darimont | ||
| * @author Anastasiia Smirnova | ||
| * @author Mark Paluch | ||
| * @author Thach Le | ||
| */ | ||
| public class PageRequest extends AbstractPageRequest { | ||
|  | ||
|  | @@ -36,13 +37,13 @@ public class PageRequest extends AbstractPageRequest { | |
| /** | ||
| * Creates a new {@link PageRequest} with sort parameters applied. | ||
| * | ||
| * @param page zero-based page index, must not be negative. | ||
| * @param size the size of the page to be returned, must be greater than 0. | ||
| * @param pageNumber zero-based pageNumber index, must not be negative. | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops, seems too much was changed by the refactoring. I'll align these upon merge. | ||
| * @param pageSize the pageSize of the pageNumber to be returned, must be greater than 0. | ||
| * @param sort must not be {@literal null}, use {@link Sort#unsorted()} instead. | ||
| */ | ||
| protected PageRequest(int page, int size, Sort sort) { | ||
| protected PageRequest(int pageNumber, int pageSize, Sort sort) { | ||
|  | ||
| super(page, size); | ||
| super(pageNumber, pageSize); | ||
|  | ||
| Assert.notNull(sort, "Sort must not be null"); | ||
|  | ||
|  | @@ -52,37 +53,37 @@ protected PageRequest(int page, int size, Sort sort) { | |
| /** | ||
| * Creates a new unsorted {@link PageRequest}. | ||
| * | ||
| * @param page zero-based page index, must not be negative. | ||
| * @param size the size of the page to be returned, must be greater than 0. | ||
| * @param pageNumber zero-based pageNumber index, must not be negative. | ||
| * @param pageSize the pageSize of the pageNumber to be returned, must be greater than 0. | ||
| * @since 2.0 | ||
| */ | ||
| public static PageRequest of(int page, int size) { | ||
| return of(page, size, Sort.unsorted()); | ||
| public static PageRequest of(int pageNumber, int pageSize) { | ||
| return of(pageNumber, pageSize, Sort.unsorted()); | ||
| } | ||
|  | ||
| /** | ||
| * Creates a new {@link PageRequest} with sort parameters applied. | ||
| * | ||
| * @param page zero-based page index. | ||
| * @param size the size of the page to be returned. | ||
| * @param pageNumber zero-based pageNumber index. | ||
| * @param pageSize the pageSize of the pageNumber to be returned. | ||
| * @param sort must not be {@literal null}, use {@link Sort#unsorted()} instead. | ||
| * @since 2.0 | ||
| */ | ||
| public static PageRequest of(int page, int size, Sort sort) { | ||
| return new PageRequest(page, size, sort); | ||
| public static PageRequest of(int pageNumber, int pageSize, Sort sort) { | ||
| return new PageRequest(pageNumber, pageSize, sort); | ||
| } | ||
|  | ||
| /** | ||
| * Creates a new {@link PageRequest} with sort direction and properties applied. | ||
| * | ||
| * @param page zero-based page index, must not be negative. | ||
| * @param size the size of the page to be returned, must be greater than 0. | ||
| * @param pageNumber zero-based pageNumber index, must not be negative. | ||
| * @param pageSize the pageSize of the pageNumber to be returned, must be greater than 0. | ||
| * @param direction must not be {@literal null}. | ||
| * @param properties must not be {@literal null}. | ||
| * @since 2.0 | ||
| */ | ||
| public static PageRequest of(int page, int size, Direction direction, String... properties) { | ||
| return of(page, size, Sort.by(direction, properties)); | ||
| public static PageRequest of(int pageNumber, int pageSize, Direction direction, String... properties) { | ||
| return of(pageNumber, pageSize, Sort.by(direction, properties)); | ||
| } | ||
|  | ||
| /** | ||
|  | @@ -126,7 +127,7 @@ public boolean equals(@Nullable Object obj) { | |
| return false; | ||
| } | ||
|  | ||
| return super.equals(that) && this.sort.equals(that.sort); | ||
| return super.equals(that) && sort.equals(that.sort); | ||
| } | ||
|  | ||
| /** | ||
|  | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not change visibility. I'm going to revert this change upon merge.