Tabnine Logo
Range$Bound.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.springframework.data.domain.Range$Bound

Best Java code snippets using org.springframework.data.domain.Range$Bound.getValue (Showing top 20 results out of 315)

origin: spring-projects/spring-data-mongodb

  /**
   * Converts the given {@link Range} into an array of values.
   *
   * @param range must not be {@literal null}.
   * @return
   */
  public static List<Long> toRangeValues(Range<Long> range) {

    Assert.notNull(range, "Range must not be null!");

    List<Long> result = new ArrayList<Long>(2);
    result.add(range.getLowerBound().getValue()
        .orElseThrow(() -> new IllegalArgumentException("Lower bound of range must be bounded!")));
    range.getUpperBound().getValue().ifPresent(it -> result.add(it));

    return result;
  }
}
origin: spring-projects/spring-data-redis

  private static <T extends Comparable<T>> T getLowerValue(Range<T> range) {
    return range.getLowerBound().getValue()
        .orElseThrow(() -> new IllegalArgumentException("Range does not contain lower bound value!"));
  }
}
origin: spring-projects/spring-data-redis

  private static <T extends Comparable<T>> T getLowerValue(Range<T> range) {
    return range.getLowerBound().getValue()
        .orElseThrow(() -> new IllegalArgumentException("Range does not contain lower bound value!"));
  }
}
origin: org.springframework.data/spring-data-mongodb

@SuppressWarnings({ "unchecked", "rawtypes" })
protected Flux<GeoResult<Object>> doExecuteQuery(@Nullable Query query, Class<?> type, String collection) {
  Point nearLocation = accessor.getGeoNearLocation();
  NearQuery nearQuery = NearQuery.near(nearLocation);
  if (query != null) {
    nearQuery.query(query);
  }
  Range<Distance> distances = accessor.getDistanceRange();
  distances.getUpperBound().getValue().ifPresent(it -> nearQuery.maxDistance(it).in(it.getMetric()));
  distances.getLowerBound().getValue().ifPresent(it -> nearQuery.minDistance(it).in(it.getMetric()));
  Pageable pageable = accessor.getPageable();
  nearQuery.with(pageable);
  return (Flux) operations.geoNear(nearQuery, type, collection);
}
origin: org.springframework.data/spring-data-mongodb

@SuppressWarnings("unchecked")
GeoResults<Object> doExecuteQuery(Query query) {
  Point nearLocation = accessor.getGeoNearLocation();
  NearQuery nearQuery = NearQuery.near(nearLocation);
  if (query != null) {
    nearQuery.query(query);
  }
  Range<Distance> distances = accessor.getDistanceRange();
  distances.getLowerBound().getValue().ifPresent(it -> nearQuery.minDistance(it).in(it.getMetric()));
  distances.getUpperBound().getValue().ifPresent(it -> nearQuery.maxDistance(it).in(it.getMetric()));
  Pageable pageable = accessor.getPageable();
  nearQuery.with(pageable);
  return (GeoResults<Object>) operation.near(nearQuery).all();
}
origin: org.springframework.data/spring-data-mongodb

@Override
public Document toDocument() {
  Document doc = new Document(super.toDocument());
  if (length != null) {
    length.getLowerBound().getValue().ifPresent(it -> doc.append("minLength", it));
    length.getUpperBound().getValue().ifPresent(it -> doc.append("maxLength", it));
  }
  if (!StringUtils.isEmpty(pattern)) {
    doc.append("pattern", pattern);
  }
  return doc;
}
origin: spring-projects/spring-data-mongodb

Optional<Distance> distance = range.getUpperBound().getValue();
Optional<Distance> minDistance = range.getLowerBound().getValue();
origin: spring-projects/spring-data-redis

@Nullable
@Override
public Long bitPos(byte[] key, boolean bit, Range<Long> range) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range must not be null! Use Range.unbounded() instead.");
  BitPosParams params = null;
  if (range.getLowerBound().isBounded()) {
    params = range.getUpperBound().isBounded()
        ? new BitPosParams(range.getLowerBound().getValue().get(), range.getUpperBound().getValue().get())
        : new BitPosParams(range.getLowerBound().getValue().get());
  }
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(params != null ? connection.getRequiredPipeline().bitpos(key, bit, params)
          : connection.getRequiredPipeline().bitpos(key, bit)));
      return null;
    }
    if (isQueueing()) {
      transaction(
          connection.newJedisResult(params != null ? connection.getRequiredTransaction().bitpos(key, bit, params)
              : connection.getRequiredTransaction().bitpos(key, bit)));
      return null;
    }
    return params != null ? connection.getJedis().bitpos(key, bit, params) : connection.getJedis().bitpos(key, bit);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}
origin: spring-projects/spring-data-redis

Object value = upper ? source.getUpperBound().getValue().orElse(null)
    : source.getLowerBound().getValue().orElse(null);
origin: spring-projects/spring-data-mongodb

@Override
public Document toDocument() {
  Document doc = new Document(super.toDocument());
  if (!CollectionUtils.isEmpty(requiredProperties)) {
    doc.append("required", requiredProperties);
  }
  if (propertiesCount != null) {
    propertiesCount.getLowerBound().getValue().ifPresent(it -> doc.append("minProperties", it));
    propertiesCount.getUpperBound().getValue().ifPresent(it -> doc.append("maxProperties", it));
  }
  if (!CollectionUtils.isEmpty(properties)) {
    doc.append("properties", reduceToDocument(properties));
  }
  if (!CollectionUtils.isEmpty(patternProperties)) {
    doc.append("patternProperties", reduceToDocument(patternProperties));
  }
  if (additionalProperties != null) {
    doc.append("additionalProperties", additionalProperties instanceof JsonSchemaObject
        ? ((JsonSchemaObject) additionalProperties).toDocument() : additionalProperties);
  }
  return doc;
}
origin: spring-projects/spring-data-mongodb

@Override
public Document toDocument() {
  Document doc = new Document(super.toDocument());
  if (multipleOf != null) {
    doc.append("multipleOf", multipleOf);
  }
  if (range != null) {
    if (range.getLowerBound().isBounded()) {
      range.getLowerBound().getValue().ifPresent(it -> doc.append("minimum", it));
      if (!range.getLowerBound().isInclusive()) {
        doc.append("exclusiveMinimum", true);
      }
    }
    if (range.getUpperBound().isBounded()) {
      range.getUpperBound().getValue().ifPresent(it -> doc.append("maximum", it));
      if (!range.getUpperBound().isInclusive()) {
        doc.append("exclusiveMaximum", true);
      }
    }
  }
  return doc;
}
origin: spring-projects/spring-data-mongodb

@Override
public Document toDocument() {
  Document doc = new Document(super.toDocument());
  if (!CollectionUtils.isEmpty(items)) {
    doc.append("items", items.size() == 1 ? items.iterator().next()
        : items.stream().map(JsonSchemaObject::toDocument).collect(Collectors.toList()));
  }
  if (range != null) {
    range.getLowerBound().getValue().ifPresent(it -> doc.append("minItems", it));
    range.getUpperBound().getValue().ifPresent(it -> doc.append("maxItems", it));
  }
  if (ObjectUtils.nullSafeEquals(uniqueItems, Boolean.TRUE)) {
    doc.append("uniqueItems", true);
  }
  if (additionalItems != null) {
    doc.append("additionalItems", additionalItems);
  }
  return doc;
}
origin: spring-projects/spring-data-mongodb

@SuppressWarnings("unchecked")
GeoResults<Object> doExecuteQuery(Query query) {
  Point nearLocation = accessor.getGeoNearLocation();
  NearQuery nearQuery = NearQuery.near(nearLocation);
  if (query != null) {
    nearQuery.query(query);
  }
  Range<Distance> distances = accessor.getDistanceRange();
  distances.getLowerBound().getValue().ifPresent(it -> nearQuery.minDistance(it).in(it.getMetric()));
  distances.getUpperBound().getValue().ifPresent(it -> nearQuery.maxDistance(it).in(it.getMetric()));
  Pageable pageable = accessor.getPageable();
  nearQuery.with(pageable);
  return (GeoResults<Object>) operation.near(nearQuery).all();
}
origin: spring-projects/spring-data-mongodb

@SuppressWarnings({ "unchecked", "rawtypes" })
protected Flux<GeoResult<Object>> doExecuteQuery(@Nullable Query query, Class<?> type, String collection) {
  Point nearLocation = accessor.getGeoNearLocation();
  NearQuery nearQuery = NearQuery.near(nearLocation);
  if (query != null) {
    nearQuery.query(query);
  }
  Range<Distance> distances = accessor.getDistanceRange();
  distances.getUpperBound().getValue().ifPresent(it -> nearQuery.maxDistance(it).in(it.getMetric()));
  distances.getLowerBound().getValue().ifPresent(it -> nearQuery.minDistance(it).in(it.getMetric()));
  Pageable pageable = accessor.getPageable();
  nearQuery.with(pageable);
  return (Flux) operations.geoNear(nearQuery, type, collection);
}
origin: spring-projects/spring-data-redis

@Override
public Long bitPos(byte[] key, boolean bit, Range<Long> range) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range must not be null! Use Range.unbounded() instead.");
  List<byte[]> args = new ArrayList<>(3);
  args.add(LettuceConverters.toBit(bit));
  if (range.getLowerBound().isBounded()) {
    args.add(range.getLowerBound().getValue().map(LettuceConverters::toBytes).get());
  }
  if (range.getUpperBound().isBounded()) {
    args.add(range.getUpperBound().getValue().map(LettuceConverters::toBytes).get());
  }
  return Long.class.cast(connection.execute("BITPOS", key, args));
}
origin: spring-projects/spring-data-redis

private static <T extends Comparable<T>> T getUpperValue(Range<T> range) {
  return range.getUpperBound().getValue()
      .orElseThrow(() -> new IllegalArgumentException("Range does not contain upper bound value!"));
}
origin: spring-projects/spring-data-redis

private static <T extends Comparable<T>> T getUpperValue(Range<T> range) {
  return range.getUpperBound().getValue()
      .orElseThrow(() -> new IllegalArgumentException("Range does not contain upper bound value!"));
}
origin: spring-projects/spring-data-redis

/**
 * Return {@link Optional} upper bound from {@link Range}.
 *
 * @param range
 * @param <T>
 * @return
 * @since 2.0.9
 */
static <T extends Comparable<T>> Optional<T> getUpperBound(org.springframework.data.domain.Range<T> range) {
  return range.getUpperBound().getValue();
}
origin: spring-projects/spring-data-redis

/**
 * Return {@link Optional} lower bound from {@link Range}.
 *
 * @param range
 * @param <T>
 * @return
 * @since 2.0.9
 */
static <T extends Comparable<T>> Optional<T> getLowerBound(org.springframework.data.domain.Range<T> range) {
  return range.getLowerBound().getValue();
}
origin: spring-projects/spring-data-mongodb

@Override
public Document toDocument() {
  Document doc = new Document(super.toDocument());
  if (length != null) {
    length.getLowerBound().getValue().ifPresent(it -> doc.append("minLength", it));
    length.getUpperBound().getValue().ifPresent(it -> doc.append("maxLength", it));
  }
  if (!StringUtils.isEmpty(pattern)) {
    doc.append("pattern", pattern);
  }
  return doc;
}
org.springframework.data.domainRange$BoundgetValue

Popular methods of Range$Bound

  • inclusive
  • isInclusive
  • exclusive
  • isBounded
  • unbounded
  • <init>
  • toPrefixString
  • toSuffixString

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best IntelliJ plugins
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