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

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

本文整理了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

/**
 * Tests whether the settings of the given {@link Query} are equal to this query.
 *
 * @param that
 * @return
 */
protected boolean querySettingsEquals(Query that) {
  boolean criteriaEqual = this.criteria.equals(that.criteria);
  boolean fieldsEqual = nullSafeEquals(this.fieldSpec, that.fieldSpec);
  boolean sortEqual = this.sort.equals(that.sort);
  boolean hintEqual = nullSafeEquals(this.hint, that.hint);
  boolean skipEqual = this.skip == that.skip;
  boolean limitEqual = this.limit == that.limit;
  boolean metaEqual = nullSafeEquals(this.meta, that.meta);
  boolean collationEqual = nullSafeEquals(this.collation.orElse(null), that.collation.orElse(null));
  return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual
      && collationEqual;
}

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

/**
 * Tests whether the settings of the given {@link Query} are equal to this query.
 *
 * @param that
 * @return
 */
protected boolean querySettingsEquals(Query that) {
  boolean criteriaEqual = this.criteria.equals(that.criteria);
  boolean fieldsEqual = nullSafeEquals(this.fieldSpec, that.fieldSpec);
  boolean sortEqual = this.sort.equals(that.sort);
  boolean hintEqual = nullSafeEquals(this.hint, that.hint);
  boolean skipEqual = this.skip == that.skip;
  boolean limitEqual = this.limit == that.limit;
  boolean metaEqual = nullSafeEquals(this.meta, that.meta);
  boolean collationEqual = nullSafeEquals(this.collation.orElse(null), that.collation.orElse(null));
  return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual
      && collationEqual;
}

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

@Override
public boolean equals(final Object obj) {
  if (this == obj) {
    return true;
  }
  if (!(obj instanceof PageRequest)) {
    return false;
  }
  PageRequest that = (PageRequest) obj;
  boolean pageEqual = this.page == that.page;
  boolean sizeEqual = this.size == that.size;
  boolean sortEqual = this.sort == null ? that.sort == null : this.sort.equals(that.sort);
  return pageEqual && sizeEqual && sortEqual;
}

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

@Override
public boolean equals(@Nullable Object obj) {
  if (this == obj) {
    return true;
  }
  if (!(obj instanceof PageRequest)) {
    return false;
  }
  PageRequest that = (PageRequest) obj;
  return super.equals(that) && this.sort.equals(that.sort);
}

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

/**
 * @param sort
 *            The {@link Sort} to check that no sort is specified
 * @throws UnsupportedOperationException
 *             if a {@code sort} is initialized (non-null && not
 *             {@link Sort#unsorted()}
 */
default void ensureNoSort(Sort sort) throws UnsupportedOperationException {
  if (!Sort.unsorted().equals(sort)) {
    throwUnsupportedSortOperationException();
  }
}

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

@Override
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null || !(obj instanceof Pageable)) {
    return false;
  }
  Pageable other = (Pageable) obj;
  if (page != other.getPageNumber()) {
    return false;
  }
  if (size != other.getPageSize()) {
    return false;
  }
  if (sort == null) {
    if (other.getSort() != null) {
      return false;
    }
  } else if (!sort.equals(other.getSort())) {
    return false;
  }
  return true;
}

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

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (!(o instanceof KeysetPageable)) {
    return false;
  }
  KeysetPageable that = (KeysetPageable) o;
  if (getIntOffset() != that.getIntOffset()) {
    return false;
  }
  if (getPageSize() != that.getPageSize()) {
    return false;
  }
  if (getKeysetPage() != null ? !getKeysetPage().equals(that.getKeysetPage()) : that.getKeysetPage() != null) {
    return false;
  }
  return getSort() != null ? getSort().equals(that.getSort()) : that.getSort() == null;
}

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

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (!(o instanceof KeysetPageable)) {
    return false;
  }
  KeysetPageable that = (KeysetPageable) o;
  if (getIntOffset() != that.getIntOffset()) {
    return false;
  }
  if (getPageSize() != that.getPageSize()) {
    return false;
  }
  if (getKeysetPage() != null ? !getKeysetPage().equals(that.getKeysetPage()) : that.getKeysetPage() != null) {
    return false;
  }
  return getSort() != null ? getSort().equals(that.getSort()) : that.getSort() == null;
}

相关文章