/** * Returns the {@link Query} annotation that is applied to the method or {@code null} if none available. * * @return */ @Nullable Query getQueryAnnotation() { return lookupQueryAnnotation().orElse(null); }
private Optional<String> findAnnotatedQuery() { return lookupQueryAnnotation() // .map(Query::value) // .filter(StringUtils::hasText); }
/** * Get the sort value, used as default, extracted from the {@link Query} annotation. * * @return the {@link Query#sort()} value. * @throws IllegalStateException if method not annotated with {@link Query}. Make sure to check * {@link #hasAnnotatedQuery()} first. * @since 2.1 */ public String getAnnotatedSort() { return lookupQueryAnnotation().map(Query::sort).orElseThrow(() -> new IllegalStateException( "Expected to find @Query annotation but did not. Make sure to check hasAnnotatedSort() before.")); }
/** * Returns the field specification to be used for the query. * * @return */ @Nullable String getFieldSpecification() { return lookupQueryAnnotation() // .map(Query::fields) // .filter(StringUtils::hasText) // .orElse(null); }
/** * Check if the query method is decorated with an non empty {@link Query#sort()}. * * @return true if method annotated with {@link Query} having an non empty sort attribute. * @since 2.1 */ public boolean hasAnnotatedSort() { return lookupQueryAnnotation().map(it -> !it.sort().isEmpty()).orElse(false); }
private Optional<String> findAnnotatedQuery() { return lookupQueryAnnotation() // .map(Query::value) // .filter(StringUtils::hasText); }
/** * Returns the {@link Query} annotation that is applied to the method or {@code null} if none available. * * @return */ @Nullable Query getQueryAnnotation() { return lookupQueryAnnotation().orElse(null); }
/** * Get the sort value, used as default, extracted from the {@link Query} annotation. * * @return the {@link Query#sort()} value. * @throws IllegalStateException if method not annotated with {@link Query}. Make sure to check * {@link #hasAnnotatedQuery()} first. * @since 2.1 */ public String getAnnotatedSort() { return lookupQueryAnnotation().map(Query::sort).orElseThrow(() -> new IllegalStateException( "Expected to find @Query annotation but did not. Make sure to check hasAnnotatedSort() before.")); }
/** * Returns the field specification to be used for the query. * * @return */ @Nullable String getFieldSpecification() { return lookupQueryAnnotation() // .map(Query::fields) // .filter(StringUtils::hasText) // .orElse(null); }
/** * Check if the query method is decorated with an non empty {@link Query#sort()}. * * @return true if method annotated with {@link Query} having an non empty sort attribute. * @since 2.1 */ public boolean hasAnnotatedSort() { return lookupQueryAnnotation().map(it -> !it.sort().isEmpty()).orElse(false); }