Function apply - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Function apply method.

This code example shows how to use the following methods:apply, getClass
      return new HttpCommand(request);
   } 
 
   private Function<HttpResponse, ?> getTransformer(String commandName, HttpCommand command) {
      HttpRequest request = command.getCurrentRequest();
      Function<HttpResponse, ?> transformer = transformerForRequest.apply(request);
      logger.trace("<< response from %s is parsed by %s", commandName, transformer.getClass().getSimpleName());
      return transformer;
   } 
 
   @Override 
   public boolean equals(Object o) { 
      if (this == o)
         return true; 
      if (o == null || getClass() != o.getClass())
         return false; 
      InvokeHttpMethod that = InvokeHttpMethod.class.cast(o);
      return equal(this.annotationProcessor, that.annotationProcessor);
   } 
 
6
CodeRank
This code example shows how to use the following methods:close
        Statement stmt = null;
        try { 
            conn = dataSource.getConnection();
            stmt = conn.createStatement();
 
            function.apply(stmt);
        } finally { 
            if (stmt != null) {
                stmt.close();
            } 
            if (conn != null) {
                conn.close();
            } 
        } 
    } 
 
    /** 
     * Compares all properties of expected to actual. 
     * <ul> 
     * <li>.equals is used for comparison.</li> 
6
CodeRank
This code example shows how to use the following methods:apply
   } 
 
   @Override 
   public URI apply(@Nullable Object from) { 
      try { 
         return delegate.apply(from); 
      } finally { 
         bucketToRegionCache.invalidate(from.toString()); 
      } 
   } 
} 
6
CodeRank
This code example shows how to use the following methods:apply, getClass
      return new HttpCommand(request);
   } 
 
   private Function<HttpResponse, ?> getTransformer(String commandName, HttpCommand command) {
      HttpRequest request = command.getCurrentRequest();
      Function<HttpResponse, ?> transformer = transformerForRequest.apply(request);
      logger.trace("<< response from %s is parsed by %s", commandName, transformer.getClass().getSimpleName());
      return transformer;
   } 
 
   private boolean isFuture(Invokable<?, ?> in) {
      return in.getReturnType().getRawType().equals(ListenableFuture.class);
   } 
 
   @Override 
   public boolean equals(Object o) { 
      if (this == o)
         return true; 
      if (o == null || getClass() != o.getClass())
         return false; 
6
CodeRank
This code example shows how to use the following methods:apply
      this.parser = parser;
   } 
 
   @Override 
   public Set<String> apply(HttpResponse response) {
      return parser.apply(response);
   } 
} 
6
CodeRank
This code example shows how to use the following methods:apply
 
   @Override 
   public void reviseParsedImage(org.jclouds.ec2.domain.Image from, ImageBuilder builder, OsFamily family,
            OperatingSystem.Builder osBuilder) {
      Image image = Image.builder().id(from.getId()).name(from.getName()).build();
      OperatingSystem os = imageToOs.apply(image);
      osBuilder.description(os.getDescription());
      osBuilder.family(os.getFamily());
      osBuilder.name(os.getName());
      osBuilder.is64Bit(os.is64Bit());
      osBuilder.version(os.getVersion());
      // arch is accurate already 
   } 
} 
6
CodeRank
This code example shows how to use the following methods:apply
   @Override 
   public LoadBalancerMetadata getLoadBalancer(String id) {
      String[] parts = checkNotNull(id, "id").split("/");
      String region = parts[0];
      int lbId = Integer.parseInt(parts[1]);
      return converter.apply(client.getLoadBalancerApi(region).get(lbId));
   } 
 
} 
6
CodeRank
This code example shows how to use the following methods:apply
   } 
 
   @Override 
   public URI apply(Object from) {
      String bucket = from.toString();
      Optional<String> region = bucketToRegion.apply(bucket);
      if (region.isPresent()) {
         return delegate.apply(region.get());
      } 
      return delegate.apply(null);
   } 
} 
6
CodeRank
This code example shows how to use the following methods:apply
      this.parser = parser;
   } 
 
   @Override 
   public Set<String> apply(HttpResponse response) {
      return parser.apply(response);
   } 
} 
6
CodeRank
This code example shows how to use the following methods:apply
 
   @Override 
   public HttpRequest signGetBlob(String container, String name) {
      checkNotNull(container, "container");
      checkNotNull(name, "name");
      return cleanRequest(processor.apply(Invocation.create(getMethod, ImmutableList.<Object> of(container, name))));
   } 
 
   @Override 
   public HttpRequest signGetBlob(String container, String name, long timeInSeconds) {
      throw new UnsupportedOperationException();
   } 
 
   @Override 
   public HttpRequest signPutBlob(String container, Blob blob) {
      checkNotNull(container, "container");
      checkNotNull(blob, "blob");
      return cleanRequest(processor.apply(Invocation.create(createMethod,
            ImmutableList.<Object> of(container, blobToBlob.apply(blob)))));
   } 
6
CodeRank
apply Method Overview
Returns the result of applying this function to input.
See Code Examples for other Guava Function Methods: