Codota Logo
Pageable.getSortOr
Code IndexAdd Codota to your IDE (free)

How to use
getSortOr
method
in
org.springframework.data.domain.Pageable

Best Java code snippets using org.springframework.data.domain.Pageable.getSortOr (Showing top 1 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: apache/servicemix-bundles

private Object[] prepareParameters(Method method, MultiValueMap<String, ? extends Object> rawParameters,
    Pageable pageable, Sort sort) {
  List<MethodParameter> parameters = new MethodParameters(method, Optional.of(PARAM_ANNOTATION)).getParameters();
  if (parameters.isEmpty()) {
    return new Object[0];
  }
  Object[] result = new Object[parameters.size()];
  Sort sortToUse = pageable.getSortOr(sort);
  for (int i = 0; i < result.length; i++) {
    MethodParameter param = parameters.get(i);
    Class<?> targetType = param.getParameterType();
    if (Pageable.class.isAssignableFrom(targetType)) {
      result[i] = pageable;
    } else if (Sort.class.isAssignableFrom(targetType)) {
      result[i] = sortToUse;
    } else {
      String parameterName = param.getParameterName();
      if (!StringUtils.hasText(parameterName)) {
        throw new IllegalArgumentException(String.format(NAME_NOT_FOUND, ClassUtils.getQualifiedMethodName(method)));
      }
      Object value = unwrapSingleElement(rawParameters.get(parameterName));
      result[i] = targetType.isInstance(value) ? value : convert(value, param);
    }
  }
  return result;
}
org.springframework.data.domainPageablegetSortOr

Javadoc

Returns the current Sort or the given one if the current one is unsorted.

Popular methods of Pageable

  • getPageSize
    Returns the number of items to be returned.
  • getSort
    Returns the sorting parameters.
  • getOffset
  • getPageNumber
    Returns the page to be returned.
  • isPaged
  • unpaged
  • isUnpaged
  • previousOrFirst
  • toOptional
  • hasPrevious
  • next
  • first
  • next,
  • first

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • setContentView (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now