Toggle navigation
Home
com.google.common.util.concurrent.ListenableFuture to java.util.concurrent.CompletableFuture
No. of Instances - 21
No. of Commits - 2
No. of Projects - {'presto'}
Hierarchy/Composition: SIBLING
Primitive Info: -
NameSpace: External -> Jdk
Mapping:
Add or Remove Method invocation
MoreFutures.addTimeout(bufferResultFuture,() -> BufferResult.emptyResults(token,false),DEFAULT_MAX_WAIT_TIME,executor)
to
addTimeout(bufferResultFuture,() -> BufferResult.emptyResults(token,false),DEFAULT_MAX_WAIT_TIME,executor)
Futures.transform(bufferResultFuture,(BufferResult result) -> { List<Page> pages=result.getPages(); GenericEntity<?> entity=null; Status status; if (!pages.isEmpty()) { entity=new GenericEntity<>(pages,new TypeToken<List<Page>>(){ } .getType()); status=Status.OK; } else if (result.isBufferClosed()) { status=Status.GONE; } else { status=Status.NO_CONTENT; } return Response.status(status).entity(entity).header(PRESTO_PAGE_TOKEN,result.getToken()).header(PRESTO_PAGE_NEXT_TOKEN,result.getNextToken()).build(); } )
to
bufferResultFuture.thenApply(result -> { List<Page> pages=result.getPages(); GenericEntity<?> entity=null; Status status; if (!pages.isEmpty()) { entity=new GenericEntity<>(pages,new TypeToken<List<Page>>(){ } .getType()); status=Status.OK; } else if (result.isBufferClosed()) { status=Status.GONE; } else { status=Status.NO_CONTENT; } return Response.status(status).entity(entity).header(PRESTO_PAGE_TOKEN,result.getToken()).header(PRESTO_PAGE_NEXT_TOKEN,result.getNextToken()).build(); } )
Cascading Type Change (Similar)
ListenableFuture<Response>
to
CompletableFuture<Response>