org.springframework.data.domain.Sort.equals()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中org.springframework.data.domain.Sort.equals()方法的一些代码示例,展示了Sort.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Sort.equals()方法的具体详情如下:
包路径:org.springframework.data.domain.Sort
类名称:Sort
方法名:equals

Sort.equals介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-mongodb

  1. /**
  2. * Tests whether the settings of the given {@link Query} are equal to this query.
  3. *
  4. * @param that
  5. * @return
  6. */
  7. protected boolean querySettingsEquals(Query that) {
  8. boolean criteriaEqual = this.criteria.equals(that.criteria);
  9. boolean fieldsEqual = nullSafeEquals(this.fieldSpec, that.fieldSpec);
  10. boolean sortEqual = this.sort.equals(that.sort);
  11. boolean hintEqual = nullSafeEquals(this.hint, that.hint);
  12. boolean skipEqual = this.skip == that.skip;
  13. boolean limitEqual = this.limit == that.limit;
  14. boolean metaEqual = nullSafeEquals(this.meta, that.meta);
  15. boolean collationEqual = nullSafeEquals(this.collation.orElse(null), that.collation.orElse(null));
  16. return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual
  17. && collationEqual;
  18. }

代码示例来源:origin: org.springframework.data/spring-data-mongodb

  1. /**
  2. * Tests whether the settings of the given {@link Query} are equal to this query.
  3. *
  4. * @param that
  5. * @return
  6. */
  7. protected boolean querySettingsEquals(Query that) {
  8. boolean criteriaEqual = this.criteria.equals(that.criteria);
  9. boolean fieldsEqual = nullSafeEquals(this.fieldSpec, that.fieldSpec);
  10. boolean sortEqual = this.sort.equals(that.sort);
  11. boolean hintEqual = nullSafeEquals(this.hint, that.hint);
  12. boolean skipEqual = this.skip == that.skip;
  13. boolean limitEqual = this.limit == that.limit;
  14. boolean metaEqual = nullSafeEquals(this.meta, that.meta);
  15. boolean collationEqual = nullSafeEquals(this.collation.orElse(null), that.collation.orElse(null));
  16. return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual
  17. && collationEqual;
  18. }

代码示例来源:origin: org.springframework.data/spring-data-commons-core

  1. @Override
  2. public boolean equals(final Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (!(obj instanceof PageRequest)) {
  7. return false;
  8. }
  9. PageRequest that = (PageRequest) obj;
  10. boolean pageEqual = this.page == that.page;
  11. boolean sizeEqual = this.size == that.size;
  12. boolean sortEqual = this.sort == null ? that.sort == null : this.sort.equals(that.sort);
  13. return pageEqual && sizeEqual && sortEqual;
  14. }

代码示例来源:origin: apache/servicemix-bundles

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (!(obj instanceof PageRequest)) {
  7. return false;
  8. }
  9. PageRequest that = (PageRequest) obj;
  10. return super.equals(that) && this.sort.equals(that.sort);
  11. }

代码示例来源:origin: com.github.derjust/spring-data-dynamodb

  1. /**
  2. * @param sort
  3. * The {@link Sort} to check that no sort is specified
  4. * @throws UnsupportedOperationException
  5. * if a {@code sort} is initialized (non-null && not
  6. * {@link Sort#unsorted()}
  7. */
  8. default void ensureNoSort(Sort sort) throws UnsupportedOperationException {
  9. if (!Sort.unsorted().equals(sort)) {
  10. throwUnsupportedSortOperationException();
  11. }
  12. }

代码示例来源:origin: spring-projects/spring-data-solr

  1. @Override
  2. public boolean equals(Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || !(obj instanceof Pageable)) {
  7. return false;
  8. }
  9. Pageable other = (Pageable) obj;
  10. if (page != other.getPageNumber()) {
  11. return false;
  12. }
  13. if (size != other.getPageSize()) {
  14. return false;
  15. }
  16. if (sort == null) {
  17. if (other.getSort() != null) {
  18. return false;
  19. }
  20. } else if (!sort.equals(other.getSort())) {
  21. return false;
  22. }
  23. return true;
  24. }

代码示例来源:origin: com.blazebit/blaze-persistence-integration-spring-data-base

  1. @Override
  2. public boolean equals(Object o) {
  3. if (this == o) {
  4. return true;
  5. }
  6. if (!(o instanceof KeysetPageable)) {
  7. return false;
  8. }
  9. KeysetPageable that = (KeysetPageable) o;
  10. if (getIntOffset() != that.getIntOffset()) {
  11. return false;
  12. }
  13. if (getPageSize() != that.getPageSize()) {
  14. return false;
  15. }
  16. if (getKeysetPage() != null ? !getKeysetPage().equals(that.getKeysetPage()) : that.getKeysetPage() != null) {
  17. return false;
  18. }
  19. return getSort() != null ? getSort().equals(that.getSort()) : that.getSort() == null;
  20. }

代码示例来源:origin: Blazebit/blaze-persistence

  1. @Override
  2. public boolean equals(Object o) {
  3. if (this == o) {
  4. return true;
  5. }
  6. if (!(o instanceof KeysetPageable)) {
  7. return false;
  8. }
  9. KeysetPageable that = (KeysetPageable) o;
  10. if (getIntOffset() != that.getIntOffset()) {
  11. return false;
  12. }
  13. if (getPageSize() != that.getPageSize()) {
  14. return false;
  15. }
  16. if (getKeysetPage() != null ? !getKeysetPage().equals(that.getKeysetPage()) : that.getKeysetPage() != null) {
  17. return false;
  18. }
  19. return getSort() != null ? getSort().equals(that.getSort()) : that.getSort() == null;
  20. }

相关文章