Tabnine Logo
Sort$NullHandling
Code IndexAdd Tabnine to your IDE (free)

How to use
Sort$NullHandling
in
org.springframework.data.domain

Best Java code snippets using org.springframework.data.domain.Sort$NullHandling (Showing top 11 results out of 315)

origin: spring-projects/spring-data-keyvalue

if (!NullHandling.NATIVE.equals(order.getNullHandling())) {
  spelSort = NullHandling.NULLS_FIRST.equals(order.getNullHandling()) ? spelSort.nullsFirst()
      : spelSort.nullsLast();
origin: apache/servicemix-bundles

@Override
public int hashCode() {
  int result = 17;
  result = 31 * result + direction.hashCode();
  result = 31 * result + property.hashCode();
  result = 31 * result + (ignoreCase ? 1 : 0);
  result = 31 * result + nullHandling.hashCode();
  return result;
}
origin: apache/servicemix-bundles

if (!NullHandling.NATIVE.equals(order.getNullHandling())) {
  spelSort = NullHandling.NULLS_FIRST.equals(order.getNullHandling()) ? spelSort.nullsFirst()
      : spelSort.nullsLast();
origin: org.springframework.data/spring-data-keyvalue

if (!NullHandling.NATIVE.equals(order.getNullHandling())) {
  spelSort = NullHandling.NULLS_FIRST.equals(order.getNullHandling()) ? spelSort.nullsFirst()
      : spelSort.nullsLast();
origin: mmnaseri/spring-data-mock

/**
 * Given a sort parameter from the Spring Data framework, will determine the appropriate sort metadata compatible
 * with this framework
 * @param sort    the sort specification
 * @return converted sort metadata
 */
protected Sort getSort(org.springframework.data.domain.Sort sort) {
  final List<Order> orders = new ArrayList<>();
  for (org.springframework.data.domain.Sort.Order order : sort) {
    final SortDirection sortDirection = order.getDirection().equals(ASC) ? SortDirection.ASCENDING : SortDirection.DESCENDING;
    final NullHandling nullHandling = order.getNullHandling().equals(NULLS_FIRST) ? NullHandling.NULLS_FIRST : (order.getNullHandling().equals(NULLS_LAST) ? NullHandling.NULLS_LAST : NullHandling.DEFAULT);
    orders.add(new ImmutableOrder(sortDirection, order.getProperty(), nullHandling));
  }
  return new ImmutableSort(orders);
}
origin: org.bremersee/bremersee-comparator

/**
 * Transforms a {@code Sort.Order} object into a comparator item.
 * 
 * @param sortOrder
 *            the {@code Sort.Order} object
 * @return the comparator item
 */
public static ComparatorItem fromSortOrder(Sort.Order sortOrder) {
  if (sortOrder == null || sortOrder.getProperty() == null || sortOrder.getProperty().trim().length() == 0) {
    return null;
  }
  boolean nullIsFirst = Sort.NullHandling.NULLS_FIRST.equals(sortOrder.getNullHandling());
  return new ComparatorItem(sortOrder.getProperty(), sortOrder.isAscending(), sortOrder.isIgnoreCase(),
      nullIsFirst);
}
origin: com.mmnaseri.utils/spring-data-mock

/**
 * Given a sort parameter from the Spring Data framework, will determine the appropriate sort metadata compatible
 * with this framework
 * @param sort    the sort specification
 * @return converted sort metadata
 */
protected Sort getSort(org.springframework.data.domain.Sort sort) {
  final List<Order> orders = new ArrayList<>();
  for (org.springframework.data.domain.Sort.Order order : sort) {
    final SortDirection sortDirection = order.getDirection().equals(ASC) ? SortDirection.ASCENDING : SortDirection.DESCENDING;
    final NullHandling nullHandling = order.getNullHandling().equals(NULLS_FIRST) ? NullHandling.NULLS_FIRST : (order.getNullHandling().equals(NULLS_LAST) ? NullHandling.NULLS_LAST : NullHandling.DEFAULT);
    orders.add(new ImmutableOrder(sortDirection, order.getProperty(), nullHandling));
  }
  return new ImmutableSort(orders);
}
origin: org.springframework.cloud/spring-cloud-gcp-data-datastore

private static StructuredQuery.OrderBy createOrderBy(DatastorePersistentEntity<?> persistentEntity,
    Sort.Order order) {
  if (order.isIgnoreCase()) {
    throw new DatastoreDataException("Datastore doesn't support sorting ignoring case");
  }
  if (!order.getNullHandling().equals(Sort.NullHandling.NATIVE)) {
    throw new DatastoreDataException("Datastore supports only NullHandling.NATIVE null handling");
  }
  return new StructuredQuery.OrderBy(
      persistentEntity.getPersistentProperty(order.getProperty()).getFieldName(),
      (order.getDirection() == Sort.Direction.DESC)
          ? StructuredQuery.OrderBy.Direction.DESCENDING
          : StructuredQuery.OrderBy.Direction.ASCENDING);
}
origin: spring-cloud/spring-cloud-gcp

private static StructuredQuery.OrderBy createOrderBy(DatastorePersistentEntity<?> persistentEntity,
    Sort.Order order) {
  if (order.isIgnoreCase()) {
    throw new DatastoreDataException("Datastore doesn't support sorting ignoring case");
  }
  if (!order.getNullHandling().equals(Sort.NullHandling.NATIVE)) {
    throw new DatastoreDataException("Datastore supports only NullHandling.NATIVE null handling");
  }
  return new StructuredQuery.OrderBy(
      persistentEntity.getPersistentProperty(order.getProperty()).getFieldName(),
      (order.getDirection() == Sort.Direction.DESC)
          ? StructuredQuery.OrderBy.Direction.DESCENDING
          : StructuredQuery.OrderBy.Direction.ASCENDING);
}
origin: apache/servicemix-bundles

  @Override
  public String toString() {
    String result = String.format("%s: %s", property, direction);
    if (!NullHandling.NATIVE.equals(nullHandling)) {
      result += ", " + nullHandling;
    }
    if (ignoreCase) {
      result += ", ignoring case";
    }
    return result;
  }
}
origin: apache/servicemix-bundles

@Override
public boolean equals(@Nullable Object obj) {
  if (this == obj) {
    return true;
  }
  if (!(obj instanceof Order)) {
    return false;
  }
  Order that = (Order) obj;
  return this.direction.equals(that.direction) && this.property.equals(that.property)
      && this.ignoreCase == that.ignoreCase && this.nullHandling.equals(that.nullHandling);
}
org.springframework.data.domainSort$NullHandling

Javadoc

Enumeration for null handling hints that can be used in Order expressions.

Most used methods

  • equals
  • hashCode

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Kernel (java.awt.image)
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now