vertx/src/main/java/eu/internetofus/common/vertx/ComponentClientWithCache.java
/**
   * Check if the head is defined but first check if it is cached.
   *
   * @param paths to the component to post.
   *
   * @return the future with the response object.
   */
Check if the head is defined but first check if it is cached.
@param paths to the component to post.

@return the future with the response object.
Check if the head is defined but first check if it is cached . @param paths to the component to post . @return the future with the response object .
protected Future<Boolean> headWithCache(@NotNull final Object... paths) {
    final var url = this.createAbsoluteUrlWith(paths);
    final var key = "head:" + url;
    final var value = this.cache.getIfPresent(key);
    if (value != null) {
      return Future.succeededFuture(true);
    } else {
      return this.headWithAbsolute(url).map(found -> {
        if (found) {
          this.cache.put(key, "");
        }
        return found;
      });
    }
  }
protected Future < Boolean > headWithCache ( @ NotNull final Object ... paths ) { final var url = this . createAbsoluteUrlWith ( paths ) ; final var key = "head:" + url ; final var value = this . cache . getIfPresent ( key ) ; if ( value != null ) { return Future . succeededFuture ( true ) ; } else { return this . headWithAbsolute ( url ) . map ( found -> { if ( found ) { this . cache . put ( key , "" ) ; } return found ; } ) ; } }
Check if the head is defined but first check if it is cached.
Check if the head is defined but first check if it is cached .