Codota Logo
ExampleMatcher$PropertyValueTransformer
Code IndexAdd Codota to your IDE (free)

How to use
ExampleMatcher$PropertyValueTransformer
in
org.springframework.data.domain

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

  • Common ways to obtain ExampleMatcher$PropertyValueTransformer
private void myMethod () {
ExampleMatcher$PropertyValueTransformer e =
  • Codota IconExampleMatcherAccessor exampleMatcherAccessor;String path;exampleMatcherAccessor.getValueTransformerForPath(path)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-data-redis

value = valueTransformer.apply(Optional.ofNullable(value)).orElse(null);
origin: spring-projects/spring-data-jpa

.apply(Optional.ofNullable(beanWrapper.getPropertyValue(attribute.getName())));
origin: org.springframework.data/spring-data-mongodb

Optional converted = valueTransformer.apply(Optional.ofNullable(value));
origin: apache/servicemix-bundles

  /**
   * For backwards compatibility of clients used to invoke Spring's Converter interface.
   *
   * @param source
   * @return
   */
  @Deprecated
  default Object convert(Object source) {
    return apply(Optional.ofNullable(source)).orElse(null);
  }
}
origin: spring-projects/spring-data-mongodb

Optional converted = valueTransformer.apply(Optional.ofNullable(value));
origin: com.mmnaseri.utils/spring-data-mock

/**
 * This method will create an invocation that had it occurred on a query method would provide sufficient
 * data for a parsed query method expression to be evaluated
 * @param descriptor    the query descriptor
 * @param example       the example that is used for evaluation
 * @return the fake method invocation corresponding to the example probe
 */
private Invocation createInvocation(QueryDescriptor descriptor, Example example) {
  final List<Object> values = new ArrayList<>();
  //since according to http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#query-by-example
  //the matcher only supports AND condition, so, we expect to see only one branch
  final List<List<Parameter>> branches = descriptor.getBranches();
  final List<Parameter> parameters = branches.get(0);
  for (Parameter parameter : parameters) {
    final String propertyPath = parameter.getPath();
    final Object propertyValue = PropertyUtils.getPropertyValue(example.getProbe(), propertyPath);
    final ExampleMatcher.PropertySpecifier specifier = example.getMatcher().getPropertySpecifiers().getForPath(propertyPath);
    values.add(specifier == null ? propertyValue : specifier.getPropertyValueTransformer().convert(propertyValue));
  }
  return new ImmutableInvocation(null, values.toArray());
}
origin: mmnaseri/spring-data-mock

/**
 * This method will create an invocation that had it occurred on a query method would provide sufficient
 * data for a parsed query method expression to be evaluated
 * @param descriptor    the query descriptor
 * @param example       the example that is used for evaluation
 * @return the fake method invocation corresponding to the example probe
 */
private Invocation createInvocation(QueryDescriptor descriptor, Example example) {
  final List<Object> values = new ArrayList<>();
  //since according to http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#query-by-example
  //the matcher only supports AND condition, so, we expect to see only one branch
  final List<List<Parameter>> branches = descriptor.getBranches();
  final List<Parameter> parameters = branches.get(0);
  for (Parameter parameter : parameters) {
    final String propertyPath = parameter.getPath();
    final Object propertyValue = PropertyUtils.getPropertyValue(example.getProbe(), propertyPath);
    final ExampleMatcher.PropertySpecifier specifier = example.getMatcher().getPropertySpecifiers().getForPath(propertyPath);
    values.add(specifier == null ? propertyValue : specifier.getPropertyValueTransformer().convert(propertyValue));
  }
  return new ImmutableInvocation(null, values.toArray());
}
origin: org.springframework.data/spring-data-redis

value = valueTransformer.apply(Optional.ofNullable(value)).orElse(null);
origin: apache/servicemix-bundles

value = valueTransformer.apply(Optional.ofNullable(value)).orElse(null);
origin: org.springframework.data/spring-data-jpa

.apply(Optional.ofNullable(beanWrapper.getPropertyValue(attribute.getName())));
origin: apache/servicemix-bundles

  /**
   * Transforms a given source using the {@link PropertyValueTransformer}.
   *
   * @param source
   * @return
   */
  public Optional<Object> transformValue(Optional<Object> source) {
    return getPropertyValueTransformer().apply(source);
  }
}
org.springframework.data.domainExampleMatcher$PropertyValueTransformer

Javadoc

Allows to transform the property value before it is used in the query.

Most used methods

  • apply
  • convert

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
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