signature:
public class BodyParsers { /** * Validate the content type of the passed in request using the given validator .
 * < p > If the validator returns true , the passed in accumulator will be returned to parse the body ,
 * otherwise an accumulator with a result created by the error handler will be returned .
 * @ param errorHandler The error handler used to create a bad request result if the content type
 * is not valid .
 * @ param request The request to validate .
 * @ param errorMessage The error message to pass to the error handler if the content type is not
 * valid .
 * @ param validate The validation function .
 * @ param parser The parser to use if the content type is valid .
 * @ param < A > The type to be parsed by the parser
 * @ return An accumulator to parse the body . */
public static < A > Accumulator < ByteString , F . Either < Result , A > > validateContentType ( HttpErrorHandler errorHandler , Http . RequestHeader request , String errorMessage , Function < String , Boolean > validate , Function < Http . RequestHeader , Accumulator < ByteString , F . Either < Result , A > > > parser ) { } }

implementation: if ( request . contentType ( ) . map ( validate ) . orElse ( false ) ) { return parser . apply ( request ) ; } else { CompletionStage < Result > result = errorHandler . onClientError ( request , Status$ . MODULE$ . UNSUPPORTED_MEDIA_TYPE ( ) , errorMessage ) ; return Accumulator . done ( result . thenApply ( F . Either :: Left ) ) ;


signature:
public class Logger { /** * Obtain a logger instance .
 * @ param name name of the logger
 * @ return a logger */
public static ALogger of ( String name ) { } }

implementation: return new ALogger ( play . api . Logger . apply ( name ) ) ;


signature:
public class Logger { /** * Obtain a logger instance .
 * @ param clazz a class whose name will be used as logger name
 * @ return a logger */
public static ALogger of ( Class < ? > clazz ) { } }

implementation: return new ALogger ( play . api . Logger . apply ( clazz ) ) ;


signature:
public class Logger { /** * Log a message with the TRACE level .
 * @ param message message to log
 * @ param args The arguments to apply to the message String
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void trace ( String message , Object ... args ) { } }

implementation: logger . trace ( message , args ) ;


signature:
public class Logger { /** * Log a message with the TRACE level .
 * @ param message message to log
 * @ param args Suppliers that contain arguments to apply to the message String
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void trace ( String message , Supplier < ? > ... args ) { } }


signature:
public class Logger { /** * Log a message with the TRACE level .
 * @ param message message to log
 * @ param error associated exception
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void trace ( String message , Throwable error ) { } }

implementation: logger . trace ( message , error ) ;


signature:
public class Logger { /** * Log a message with the DEBUG level .
 * @ param message message to log
 * @ param args The arguments to apply to the message String
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void debug ( String message , Object ... args ) { } }

implementation: logger . debug ( message , args ) ;


signature:
public class Logger { /** * Log a message with the DEBUG level .
 * @ param message message to log
 * @ param args Suppliers that contain arguments to apply to the message String
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void debug ( String message , Supplier < ? > ... args ) { } }


signature:
public class Logger { /** * Log a message with the DEBUG level .
 * @ param message message to log
 * @ param error associated exception
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void debug ( String message , Throwable error ) { } }

implementation: logger . debug ( message , error ) ;


signature:
public class Logger { /** * Log a message with the INFO level .
 * @ param message message to log
 * @ param args The arguments to apply to the message string
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void info ( String message , Object ... args ) { } }

implementation: logger . info ( message , args ) ;


signature:
public class Logger { /** * Log a message with the INFO level .
 * @ param message message to log
 * @ param args Suppliers that contain arguments to apply to the message String
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void info ( String message , Supplier < ? > ... args ) { } }


signature:
public class Logger { /** * Log a message with the INFO level .
 * @ param message message to log
 * @ param error associated exception
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void info ( String message , Throwable error ) { } }

implementation: logger . info ( message , error ) ;


signature:
public class Logger { /** * Log a message with the WARN level .
 * @ param message message to log
 * @ param args The arguments to apply to the message string
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void warn ( String message , Object ... args ) { } }

implementation: logger . warn ( message , args ) ;


signature:
public class Logger { /** * Log a message with the WARN level .
 * @ param message message to log
 * @ param args Suppliers that contain arguments to apply to the message String
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void warn ( String message , Supplier < ? > ... args ) { } }


signature:
public class Logger { /** * Log a message with the WARN level .
 * @ param message message to log
 * @ param error associated exception
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void warn ( String message , Throwable error ) { } }

implementation: logger . warn ( message , error ) ;


signature:
public class Logger { /** * Log a message with the ERROR level .
 * @ param message message to log
 * @ param args The arguments to apply to the message string
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void error ( String message , Object ... args ) { } }

implementation: logger . error ( message , args ) ;


signature:
public class Logger { /** * Log a message with the ERROR level .
 * @ param message message to log
 * @ param args Suppliers that contain arguments to apply to the message String
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void error ( String message , Supplier < ? > args ) { } }


signature:
public class Logger { /** * Log a message with the ERROR level .
 * @ param message message to log
 * @ param error associated exception
 * @ deprecated Deprecated as of 2.7.0 . Create an instance of { @ link ALogger } via { @ link
 * # of ( String ) } / { @ link # of ( Class ) } and use the same - named method . Or use SLF4J directly . */
@ Deprecated public static void error ( String message , Throwable error ) { } }

implementation: logger . error ( message , error ) ;


signature:
public class MappedConstraintValidatorFactory { /** * Adds validator as a singleton .
 * @ param key the constraint validator type
 * @ param constraintValidator the constraint validator instance
 * @ param < T > the type of constraint validator implementation
 * @ return { @ link MappedConstraintValidatorFactory } with the given constraint validator added . */
public < T extends ConstraintValidator < ? , ? > > MappedConstraintValidatorFactory addConstraintValidator ( Class < T > key , T constraintValidator ) { } }

implementation: validators . put ( key , ( ) -> constraintValidator ) ; return this ;


signature:
public class MappedConstraintValidatorFactory { /** * need to do so . */
private < T extends ConstraintValidator < ? , ? > > T newInstance ( Class < T > key ) { } }

implementation: try { return key . getDeclaredConstructor ( ) . newInstance ( ) ; } catch ( InstantiationException | RuntimeException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ex ) { throw new RuntimeException ( ex ) ; }


signature:
public class Clients { /** * # clients - show - action */
public Result show ( Long id ) { } }

implementation: Client client = clientService . findById ( id ) ; return ok ( views . html . Client . show ( client ) ) ;


signature:
public class JavaRangeRequestController { /** * # range - request */
public Result video ( Http . Request request , Long videoId ) { } }

implementation: File videoFile = getVideoFile ( videoId ) ; return RangeResults . ofFile ( request , videoFile ) ;


signature:
public class MethodUtils { /** * Returns an accessible method ( that is , one that can be invoked via reflection ) that implements
 * the specified Method . If no such method can be found , return { @ code null } .
 * @ param method The method that we wish to call
 * @ return The accessible method */
public static Method getAccessibleMethod ( Method method ) { } }

implementation:
if ( ! MemberUtils . isAccessible ( method ) ) { return null ; } // If the declaring class is public , we are done
final Class < ? > cls = method . getDeclaringClass ( ) ; if ( Modifier . isPublic ( cls . getModifiers ( ) ) ) { return method ; } final String methodName = method . getName ( ) ; final Class < ? > [ ] parameterTypes = method . getParameterTypes ( ) ; // Check the implemented interfaces and subinterfaces
method = getAccessibleMethodFromInterfaceNest ( cls , methodName , parameterTypes ) ; // Check the superclass chain
if ( method == null ) { method = getAccessibleMethodFromSuperclass ( cls , methodName , parameterTypes ) ; } return method ;


signature:
public class MethodUtils { /** * Returns an accessible method ( that is , one that can be invoked via reflection ) by scanning
 * through the superclasses . If no such method can be found , return { @ code null } .
 * @ param cls Class to be checked
 * @ param methodName Method name of the method we wish to call
 * @ param parameterTypes The parameter type signatures
 * @ return the accessible method or { @ code null } if not found */
private static Method getAccessibleMethodFromSuperclass ( final Class < ? > cls , final String methodName , final Class < ? > ... parameterTypes ) { } }

implementation: Class < ? > parentClass = cls . getSuperclass ( ) ; while ( parentClass != null ) { if ( Modifier . isPublic ( parentClass . getModifiers ( ) ) ) { try { return parentClass . getMethod ( methodName , parameterTypes ) ; } catch ( final NoSuchMethodException e ) { return null ; } } parentClass = parentClass . getSuperclass ( ) ; } return null ;


signature:
public class MethodUtils { /** * Finds an accessible method that matches the given name and has compatible parameters .
 * Compatible parameters mean that every method parameter is assignable from the given parameters .
 * In other words , it finds a method with the given name that will take the parameters given .
 * < p > This method can match primitive parameter by passing in wrapper classes . For example , a
 * { @ code Boolean } will match a primitive { @ code boolean } parameter .
 * @ param cls find method in this class
 * @ param methodName find method with this name
 * @ param parameterTypes find method with most compatible parameters
 * @ return The accessible method */
public static Method getMatchingAccessibleMethod ( final Class < ? > cls , final String methodName , final Class < ? > ... parameterTypes ) { } }

implementation:
try { final Method method = cls . getMethod ( methodName , parameterTypes ) ; MemberUtils . setAccessibleWorkaround ( method ) ; return method ; } catch ( final NoSuchMethodException e ) { // NOPMD - Swallow the exception
} // search through all methods
Method bestMatch = null ; final Method [ ] methods = cls . getMethods ( ) ; for ( final Method method : methods ) { // compare name and parameters
if ( method . getName ( ) . equals ( methodName ) && MemberUtils . isMatchingMethod ( method , parameterTypes ) ) { // get accessible version of method
final Method accessibleMethod = getAccessibleMethod ( method ) ; if ( accessibleMethod != null && ( bestMatch == null || MemberUtils . compareMethodFit ( accessibleMethod , bestMatch , parameterTypes ) < 0 ) ) { bestMatch = accessibleMethod ; } } } if ( bestMatch != null ) { MemberUtils . setAccessibleWorkaround ( bestMatch ) ; } if ( bestMatch != null && bestMatch . isVarArgs ( ) && bestMatch . getParameterTypes ( ) . length > 0 && parameterTypes . length > 0 ) { final Class < ? > [ ] methodParameterTypes = bestMatch . getParameterTypes ( ) ; final Class < ? > methodParameterComponentType = methodParameterTypes [ methodParameterTypes . length - 1 ] . getComponentType ( ) ; final String methodParameterComponentTypeName = ClassUtils . primitiveToWrapper ( methodParameterComponentType ) . getName ( ) ; final String parameterTypeName = parameterTypes [ parameterTypes . length - 1 ] . getName ( ) ; final String parameterTypeSuperClassName = parameterTypes [ parameterTypes . length - 1 ] . getSuperclass ( ) . getName ( ) ; if ( ! methodParameterComponentTypeName . equals ( parameterTypeName ) && ! methodParameterComponentTypeName . equals ( parameterTypeSuperClassName ) ) { return null ; } } return bestMatch ;


signature:
public class DefaultHttpErrorHandler { /** * Invoked when a client error occurs , that is , an error in the 4xx series .
 * < p > The base implementation calls onBadRequest , onForbidden , onNotFound , or onOtherClientError
 * depending on the HTTP status code .
 * @ param request The request that caused the client error .
 * @ param statusCode The error status code . Must be greater or equal to 400 , and less than 500.
 * @ param message The error message .
 * @ return a CompletionStage containing the Result . */
@ Override public CompletionStage < Result > onClientError ( RequestHeader request , int statusCode , String message ) { } }

implementation: if ( statusCode == 400 ) { return onBadRequest ( request , message ) ; } else if ( statusCode == 403 ) { return onForbidden ( request , message ) ; } else if ( statusCode == 404 ) { return onNotFound ( request , message ) ; } else if ( statusCode >= 400 && statusCode < 500 ) { return onOtherClientError ( request , statusCode , message ) ; } else { throw new IllegalArgumentException ( "onClientError invoked with non client error status code " + statusCode + ": " + message ) ; }


signature:
public class DefaultHttpErrorHandler { /** * Invoked when a client makes a bad request .
 * < p > Returns Results . badRequest ( 400 ) with the included template from { @ code
 * views . html . defaultpages . badRequest } as the content .
 * @ param request The request that was bad .
 * @ param message The error message .
 * @ return a CompletionStage containing the Result . */
protected CompletionStage < Result > onBadRequest ( RequestHeader request , String message ) { } }

implementation: return CompletableFuture . completedFuture ( Results . badRequest ( views . html . defaultpages . badRequest . render ( request . method ( ) , request . uri ( ) , message , request . asScala ( ) ) ) ) ;


signature:
public class DefaultHttpErrorHandler { /** * Invoked when a client makes a request that was forbidden .
 * < p > Returns Results . forbidden ( 401 ) with the included template from { @ code
 * views . html . defaultpages . unauthorized } as the content .
 * @ param request The forbidden request .
 * @ param message The error message .
 * @ return a CompletionStage containing the Result . */
protected CompletionStage < Result > onForbidden ( RequestHeader request , String message ) { } }

implementation: return CompletableFuture . completedFuture ( Results . forbidden ( views . html . defaultpages . unauthorized . render ( request . asScala ( ) ) ) ) ;


signature:
public class DefaultHttpErrorHandler { /** * Invoked when a handler or resource is not found .
 * < p > If the environment ' s mode is production , then returns Results . notFound ( 404 ) with the
 * included template from ` views . html . defaultpages . notFound ` as the content .
 * < p > Otherwise , Results . notFound ( 404 ) is rendered with { @ code
 * views . html . defaultpages . devNotFound } template .
 * @ param request The request that no handler was found to handle .
 * @ param message A message , which is not used by the default implementation .
 * @ return a CompletionStage containing the Result . */
protected CompletionStage < Result > onNotFound ( RequestHeader request , String message ) { } }

implementation: if ( environment . isProd ( ) ) { return CompletableFuture . completedFuture ( Results . notFound ( views . html . defaultpages . notFound . render ( request . method ( ) , request . uri ( ) , request . asScala ( ) ) ) ) ; } else { return CompletableFuture . completedFuture ( Results . notFound ( views . html . defaultpages . devNotFound . render ( request . method ( ) , request . uri ( ) , Some . apply ( routes . get ( ) ) , request . asScala ( ) ) ) ) ; }


signature:
public class DefaultHttpErrorHandler { /** * Invoked when a server error occurs .
 * < p > By default , the implementation of this method delegates to [ [ onProdServerError ( ) ] ] when in
 * prod mode , and [ [ onDevServerError ( ) ] ] in dev mode . It is recommended , if you want Play ' s debug
 * info on the error page in dev mode , that you override [ [ onProdServerError ( ) ] ] instead of this
 * method .
 * @ param request The request that triggered the server error .
 * @ param exception The server error .
 * @ return a CompletionStage containing the Result . */
@ Override public CompletionStage < Result > onServerError ( RequestHeader request , Throwable exception ) { } }

implementation: try { UsefulException usefulException = throwableToUsefulException ( exception ) ; logServerError ( request , usefulException ) ; switch ( environment . mode ( ) ) { case PROD : return onProdServerError ( request , usefulException ) ; default : return onDevServerError ( request , usefulException ) ; } } catch ( Exception e ) { logger . error ( "Error while handling error" , e ) ; return CompletableFuture . completedFuture ( Results . internalServerError ( ) ) ; }


signature:
public class DefaultHttpErrorHandler { /** * Responsible for logging server errors .
 * < p > The base implementation uses a SLF4J Logger . If a special annotation is desired for internal
 * server errors , you may want to use SLF4J directly with the Marker API to distinguish server
 * errors from application errors .
 * < p > This can also be overridden to add additional logging information , eg . the id of the
 * authenticated user .
 * @ param request The request that triggered the server error .
 * @ param usefulException The server error . */
protected void logServerError ( RequestHeader request , UsefulException usefulException ) { } }

implementation: logger . error ( String . format ( "\n\n! @%s - Internal server error, for (%s) [%s] ->\n" , usefulException . id , request . method ( ) , request . uri ( ) ) , usefulException ) ;


signature:
public class DefaultHttpErrorHandler { /** * Convert the given exception to an exception that Play can report more information about .
 * < p > This will generate an id for the exception , and in dev mode , will load the source code for
 * the code that threw the exception , making it possible to report on the location that the
 * exception was thrown from . */
protected final UsefulException throwableToUsefulException ( final Throwable throwable ) { } }

implementation: return HttpErrorHandlerExceptions . throwableToUsefulException ( sourceMapper . sourceMapper ( ) , environment . isProd ( ) , throwable ) ;


signature:
public class DefaultHttpErrorHandler { /** * Invoked in dev mode when a server error occurs . Note that this method is where the URL set by
 * play . editor is used .
 * < p > The base implementation returns { @ code Results . internalServerError } with the content of
 * { @ code views . html . defaultpages . devError } .
 * @ param request The request that triggered the error .
 * @ param exception The exception .
 * @ return a CompletionStage containing the Result . */
protected CompletionStage < Result > onDevServerError ( RequestHeader request , UsefulException exception ) { } }

implementation: return CompletableFuture . completedFuture ( Results . internalServerError ( views . html . defaultpages . devError . render ( playEditor , exception , request . asScala ( ) ) ) ) ;


signature:
public class DefaultHttpErrorHandler { /** * Invoked in prod mode when a server error occurs .
 * < p > The base implementation returns { @ code Results . internalServerError } with the content of
 * { @ code views . html . defaultpages . error } template .
 * < p > Override this rather than [ [ onServerError ( ) ] ] if you don ' t want to change Play ' s debug
 * output when logging errors in dev mode .
 * @ param request The request that triggered the error .
 * @ param exception The exception .
 * @ return a CompletionStage containing the Result . */
protected CompletionStage < Result > onProdServerError ( RequestHeader request , UsefulException exception ) { } }

implementation: return CompletableFuture . completedFuture ( Results . internalServerError ( views . html . defaultpages . error . render ( exception , request . asScala ( ) ) ) ) ;


signature:
public class BuildDocHandlerFactory { /** * Create a BuildDocHandler that serves documentation from the given files , which could either be
 * directories or jar files . The baseDir array must be the same length as the files array , and the
 * corresponding entry in there for jar files is used as a base directory to use resources from in
 * the jar .
 * @ param files The directories or jar files to serve documentation from .
 * @ param baseDirs The base directories for the jar files . Entries may be null .
 * @ return a BuildDocHandler . */
public static BuildDocHandler fromResources ( File [ ] files , String [ ] baseDirs ) throws IOException { } }

implementation:
assert ( files . length == baseDirs . length ) ; FileRepository [ ] repositories = new FileRepository [ files . length ] ; List < JarFile > jarFiles = new ArrayList < > ( ) ; for ( int i = 0 ; i < files . length ; i ++ ) { File file = files [ i ] ; String baseDir = baseDirs [ i ] ; if ( file . isDirectory ( ) ) { repositories [ i ] = new FilesystemRepository ( file ) ; } else { // Assume it ' s a jar file
JarFile jarFile = new JarFile ( file ) ; jarFiles . add ( jarFile ) ; repositories [ i ] = new JarRepository ( jarFile , Option . apply ( baseDir ) ) ; } } return new DocumentationHandler ( new AggregateFileRepository ( repositories ) , ( ) -> { for ( JarFile jarFile : jarFiles ) { jarFile . close ( ) ; } } ) ;


signature:
public class BuildDocHandlerFactory { /** * Create an BuildDocHandler that serves documentation from a given directory by wrapping a
 * FilesystemRepository .
 * @ param directory The directory to serve the documentation from . */
public static BuildDocHandler fromDirectory ( File directory ) { } }

implementation: FileRepository repo = new FilesystemRepository ( directory ) ; return new DocumentationHandler ( repo ) ;


signature:
public class BuildDocHandlerFactory { /** * Create an BuildDocHandler that serves the manual from a given directory by wrapping a
 * FilesystemRepository , and the API docs from a given JAR file by wrapping a JarRepository
 * @ param directory The directory to serve the documentation from .
 * @ param jarFile The JAR file to server the documentation from .
 * @ param base The directory within the JAR file to serve the documentation from , or null if the
 * documentation should be served from the root of the JAR . */
public static BuildDocHandler fromDirectoryAndJar ( File directory , JarFile jarFile , String base ) { } }

implementation: return fromDirectoryAndJar ( directory , jarFile , base , false ) ;


signature:
public class BuildDocHandlerFactory { /** * Create an BuildDocHandler that serves the manual from a given directory by wrapping a
 * FilesystemRepository , and the API docs from a given JAR file by wrapping a JarRepository .
 * @ param directory The directory to serve the documentation from .
 * @ param jarFile The JAR file to server the documentation from .
 * @ param base The directory within the JAR file to serve the documentation from , or null if the
 * documentation should be served from the root of the JAR .
 * @ param fallbackToJar Whether the doc handler should fall back to the jar repo for docs . */
public static BuildDocHandler fromDirectoryAndJar ( File directory , JarFile jarFile , String base , boolean fallbackToJar ) { } }

implementation: FileRepository fileRepo = new FilesystemRepository ( directory ) ; FileRepository jarRepo = new JarRepository ( jarFile , Option . apply ( base ) ) ; FileRepository manualRepo ; if ( fallbackToJar ) { manualRepo = new AggregateFileRepository ( new FileRepository [ ] { fileRepo , jarRepo } ) ; } else { manualRepo = fileRepo ; } return new DocumentationHandler ( manualRepo , jarRepo ) ;


signature:
public class BuildDocHandlerFactory { /** * Create an BuildDocHandler that serves documentation from a given JAR file by wrapping a
 * JarRepository .
 * @ param jarFile The JAR file to server the documentation from .
 * @ param base The directory within the JAR file to serve the documentation from , or null if the
 * documentation should be served from the root of the JAR . */
public static BuildDocHandler fromJar ( JarFile jarFile , String base ) { } }

implementation: FileRepository repo = new JarRepository ( jarFile , Option . apply ( base ) ) ; return new DocumentationHandler ( repo ) ;


signature:
public class JavaMarkerController { /** * # # # insert : import static net . logstash . logback . marker . Markers . append ; */
private Marker requestMarker ( Http . Request request ) { } }

implementation: return append ( "host" , request . host ( ) ) . and ( append ( "path" , request . path ( ) ) ) ;


signature:
public class JavaMarkerController { /** * # logging - log - info - with - async - request - context */
public CompletionStage < Result > asyncIndex ( Http . Request request ) { } }

implementation: return CompletableFuture . supplyAsync ( ( ) -> { logger . info ( requestMarker ( request ) , "Rendering asyncIndex()" ) ; return ok ( "foo" ) ; } , httpExecutionContext . current ( ) ) ;


signature:
public class HttpEntity { /** * Consumes the data .
 * < p > This method should be used carefully , since if the source represents an ephemeral stream ,
 * then the entity may not be usable after this method is invoked .
 * @ param mat the application ' s materializer .
 * @ return a CompletionStage holding the data */
public CompletionStage < ByteString > consumeData ( Materializer mat ) { } }

implementation: return dataStream ( ) . runFold ( ByteString . empty ( ) , ByteString :: concat , mat ) ;


signature:
public class HttpEntity { /** * Create an entity from the given content .
 * @ param content The content .
 * @ param charset The charset .
 * @ return the HTTP entity . */
public static final HttpEntity fromContent ( Content content , String charset ) { } }

implementation:
String body ; if ( content instanceof Xml ) { // See https : / / github . com / playframework / playframework / issues / 2770
body = content . body ( ) . trim ( ) ; } else { body = content . body ( ) ; } return new Strict ( ByteString . fromString ( body , charset ) , Optional . of ( content . contentType ( ) + "; charset=" + charset ) ) ;


signature:
public class HttpEntity { /** * Create an entity from the given String .
 * @ param content The content .
 * @ param charset The charset .
 * @ return the HTTP entity . */
public static final HttpEntity fromString ( String content , String charset ) { } }

implementation: return new Strict ( ByteString . fromString ( content , charset ) , Optional . of ( "text/plain; charset=" + charset ) ) ;


signature:
public class HttpEntity { /** * Convert the given source of ByteStrings to a chunked entity .
 * @ param data The source .
 * @ param contentType The optional content type .
 * @ return The ByteStrings . */
public static final HttpEntity chunked ( Source < ByteString , ? > data , Optional < String > contentType ) { } }

implementation: return new Chunked ( data . map ( HttpChunk . Chunk :: new ) , contentType ) ;


signature:
public class AgeRange { /** * # bind */
@ Override public Optional < AgeRange > bind ( String key , Map < String , String [ ] > data ) { } }

implementation:
try { from = Integer . valueOf ( data . get ( "from" ) [ 0 ] ) ; to = Integer . valueOf ( data . get ( "to" ) [ 0 ] ) ; return Optional . of ( this ) ; } catch ( Exception e ) { // no parameter match return None
return Optional . empty ( ) ; }


signature:
public class AgeRange { /** * # bind */
@ Override public String javascriptUnbind ( ) { } }

implementation: return new StringBuilder ( ) . append ( "from=" ) . append ( from ) . append ( ";to=" ) . append ( to ) . toString ( ) ;


signature:
public class Results { /** * Generates a simple result .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the result ' s body content
 * @ param charset the charset to encode the content with ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result status ( int status , Content content , String charset ) { } }

implementation: if ( content == null ) { throw new NullPointerException ( "Null content" ) ; } return new Result ( status , HttpEntity . fromContent ( content , charset ) ) ;


signature:
public class Results { /** * Generates a simple result .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the result ' s body content .
 * @ param charset the charset in which to encode the content ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result status ( int status , String content , String charset ) { } }

implementation: if ( content == null ) { throw new NullPointerException ( "Null content" ) ; } return new Result ( status , HttpEntity . fromString ( content , charset ) ) ;


signature:
public class Results { /** * Generates a simple result with json content and UTF8 encoding .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the result ' s body content as a play - json object
 * @ return the result */
public static Result status ( int status , JsonNode content ) { } }

implementation: return status ( status , content , JsonEncoding . UTF8 ) ;


signature:
public class Results { /** * Generates a simple result with json content .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the result ' s body content , as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result status ( int status , JsonNode content , JsonEncoding encoding ) { } }

implementation: if ( content == null ) { throw new NullPointerException ( "Null content" ) ; } return status ( status ) . sendJson ( content , encoding ) ;


signature:
public class Results { /** * Generates a simple result with byte - array content .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the result ' s body content , as a byte array
 * @ return the result */
public static Result status ( int status , byte [ ] content ) { } }

implementation: if ( content == null ) { throw new NullPointerException ( "Null content" ) ; } return new Result ( status , new HttpEntity . Strict ( ByteString . fromArray ( content ) , Optional . empty ( ) ) ) ;


signature:
public class Results { /** * Generates a chunked result .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the input stream containing data to chunk over
 * @ param contentLength the length of the provided content in bytes .
 * @ return the result */
public static Result status ( int status , InputStream content , long contentLength ) { } }

implementation: return status ( status ) . sendInputStream ( content , contentLength ) ;


signature:
public class Results { /** * Generates a result with file contents .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the file to send
 * @ return the result */
public static Result status ( int status , File content ) { } }

implementation: return status ( status , content , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a result .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the file to send
 * @ param fileName the name that the client should receive this file as
 * @ return the result */
public static Result status ( int status , File content , String fileName ) { } }

implementation: return status ( status , content , fileName , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a result .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the file to send
 * @ param fileName the name that the client should receive this file as
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result status ( int status , File content , String fileName , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( status ) . sendFile ( content , fileName , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a result with path contents .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the path to send
 * @ return the result */
public static Result status ( int status , Path content ) { } }


signature:
public class Results { /** * Generates a result with path contents .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the path to send
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result status ( int status , Path content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( status ) . sendPath ( content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a result .
 * @ param status the HTTP status for this result e . g . 200 ( OK ) , 404 ( NOT _ FOUND )
 * @ param content the path to send
 * @ param fileName the name that the client should receive this path as
 * @ return the result */
public static Result status ( int status , Path content , String fileName ) { } }


signature:
public class Results { /** * Generates a 200 OK result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result ok ( String content , String charset ) { } }

implementation: return status ( OK , content , charset ) ;


signature:
public class Results { /** * Generates a 200 OK result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result ok ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( OK , content , encoding ) ;


signature:
public class Results { /** * Generates a 200 OK result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result ok ( File content , boolean inline ) { } }

implementation: return ok ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 200 OK result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result ok ( File content , String filename ) { } }

implementation: return ok ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 200 OK result .
 * @ param content The path to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result ok ( Path content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( OK , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 200 OK result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result ok ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 200 OK result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result ok ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 201 Created result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result created ( Content content , String charset ) { } }

implementation: return status ( CREATED , content , charset ) ;


signature:
public class Results { /** * Generates a 201 Created result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result created ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( CREATED , content , encoding ) ;


signature:
public class Results { /** * Generates a 201 Created result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result created ( File content , boolean inline ) { } }

implementation: return created ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 201 Created result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result created ( File content , String filename ) { } }

implementation: return created ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 201 Created result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result created ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 201 Created result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result created ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 201 Created result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ param filename The name to send the file as .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result created ( Path content , boolean inline , String filename , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( CREATED , content , inline , filename , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 400 Bad Request result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result badRequest ( Content content , String charset ) { } }

implementation: return status ( BAD_REQUEST , content , charset ) ;


signature:
public class Results { /** * Generates a 400 Bad Request result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result badRequest ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( BAD_REQUEST , content , encoding ) ;


signature:
public class Results { /** * Generates a 400 Bad Request result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result badRequest ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( BAD_REQUEST , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 400 Bad Request result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result badRequest ( File content , boolean inline ) { } }

implementation: return badRequest ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 400 Bad Request result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result badRequest ( File content , String filename ) { } }

implementation: return badRequest ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 400 Bad Request result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result badRequest ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 400 Bad Request result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result badRequest ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 401 Unauthorized result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result unauthorized ( Content content , String charset ) { } }

implementation: return status ( UNAUTHORIZED , content , charset ) ;


signature:
public class Results { /** * Generates a 401 Unauthorized result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result unauthorized ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( UNAUTHORIZED , content , encoding ) ;


signature:
public class Results { /** * Generates a 401 Unauthorized result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result unauthorized ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( UNAUTHORIZED , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 401 Unauthorized result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result unauthorized ( File content , boolean inline ) { } }

implementation: return unauthorized ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 401 Unauthorized result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result unauthorized ( File content , String filename ) { } }

implementation: return unauthorized ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 401 Unauthorized result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result unauthorized ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 401 Unauthorized result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result unauthorized ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 402 Payment Required result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result paymentRequired ( String content , String charset ) { } }

implementation: return status ( PAYMENT_REQUIRED , content , charset ) ;


signature:
public class Results { /** * Generates a 402 Payment Required result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result paymentRequired ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( PAYMENT_REQUIRED , content , encoding ) ;


signature:
public class Results { /** * Generates a 402 Payment Required result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result paymentRequired ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( PAYMENT_REQUIRED , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 402 Payment Required result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result paymentRequired ( File content , boolean inline ) { } }

implementation: return paymentRequired ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 402 Payment Required result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result paymentRequired ( File content , String filename ) { } }

implementation: return paymentRequired ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 402 Payment Required result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result paymentRequired ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 402 Payment Required result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result paymentRequired ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 403 Forbidden result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result forbidden ( Content content , String charset ) { } }

implementation: return status ( FORBIDDEN , content , charset ) ;


signature:
public class Results { /** * Generates a 403 Forbidden result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result forbidden ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( FORBIDDEN , content , encoding ) ;


signature:
public class Results { /** * Generates a 403 Forbidden result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result forbidden ( File content , boolean inline ) { } }

implementation: return forbidden ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 403 Forbidden result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result forbidden ( File content , String filename ) { } }

implementation: return forbidden ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 403 Forbidden result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ param filename The name to send the file as .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result forbidden ( File content , boolean inline , String filename , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( FORBIDDEN , content , inline , filename , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 403 Forbidden result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result forbidden ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 403 Forbidden result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result forbidden ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 404 Not Found result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result notFound ( Content content , String charset ) { } }

implementation: return status ( NOT_FOUND , content , charset ) ;


signature:
public class Results { /** * Generates a 404 Not Found result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result notFound ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( NOT_FOUND , content , encoding ) ;


signature:
public class Results { /** * Generates a 404 Not Found result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result notFound ( File content , boolean inline ) { } }

implementation: return notFound ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 404 Not Found result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result notFound ( File content , String filename ) { } }

implementation: return notFound ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 404 Not Found result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result notFound ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 404 Not Found result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result notFound ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 404 Not Found result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result notFound ( Path content , String filename , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( NOT_FOUND , content , filename , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 406 Not Acceptable result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result notAcceptable ( Content content , String charset ) { } }

implementation: return status ( NOT_ACCEPTABLE , content , charset ) ;


signature:
public class Results { /** * Generates a 406 Not Acceptable result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result notAcceptable ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( NOT_ACCEPTABLE , content , encoding ) ;


signature:
public class Results { /** * Generates a 406 Not Acceptable result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result notAcceptable ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( NOT_ACCEPTABLE , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 406 Not Acceptable result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result notAcceptable ( File content , boolean inline ) { } }

implementation: return notAcceptable ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 406 Not Acceptable result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result notAcceptable ( File content , String filename ) { } }

implementation: return notAcceptable ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 406 Not Acceptable result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result notAcceptable ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 406 Not Acceptable result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result notAcceptable ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 415 Unsupported Media Type result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result unsupportedMediaType ( String content , String charset ) { } }

implementation: return status ( UNSUPPORTED_MEDIA_TYPE , content , charset ) ;


signature:
public class Results { /** * Generates a 415 Unsupported Media Type result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result unsupportedMediaType ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( UNSUPPORTED_MEDIA_TYPE , content , encoding ) ;


signature:
public class Results { /** * Generates a 415 Unsupported Media Type result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result unsupportedMediaType ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( UNSUPPORTED_MEDIA_TYPE , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 415 Unsupported Media Type result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result unsupportedMediaType ( File content , boolean inline ) { } }

implementation: return unsupportedMediaType ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 415 Unsupported Media Type result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result unsupportedMediaType ( File content , String filename ) { } }

implementation: return unsupportedMediaType ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 415 Unsupported Media Type result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result unsupportedMediaType ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 415 Unsupported Media Type result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result unsupportedMediaType ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 428 Precondition Required result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result preconditionRequired ( Content content , String charset ) { } }

implementation: return status ( PRECONDITION_REQUIRED , content , charset ) ;


signature:
public class Results { /** * Generates a 428 Precondition Required result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result preconditionRequired ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( PRECONDITION_REQUIRED , content , encoding ) ;


signature:
public class Results { /** * Generates a 428 Precondition Required result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result preconditionRequired ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( PRECONDITION_REQUIRED , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 428 Precondition Required result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result preconditionRequired ( File content , boolean inline ) { } }

implementation: return preconditionRequired ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 428 Precondition Required result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result preconditionRequired ( File content , String filename ) { } }

implementation: return preconditionRequired ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 428 Precondition Required result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result preconditionRequired ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 428 Precondition Required result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result preconditionRequired ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 429 Too Many Requests result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result tooManyRequests ( Content content , String charset ) { } }

implementation: return status ( TOO_MANY_REQUESTS , content , charset ) ;


signature:
public class Results { /** * Generates a 429 Too Many Requests result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result tooManyRequests ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( TOO_MANY_REQUESTS , content , encoding ) ;


signature:
public class Results { /** * Generates a 429 Too Many Requests result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result tooManyRequests ( File content , boolean inline ) { } }

implementation: return tooManyRequests ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 429 Too Many Requests result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result tooManyRequests ( File content , String filename ) { } }

implementation: return tooManyRequests ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 429 Too Many Requests result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result tooManyRequests ( File content , String filename , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( TOO_MANY_REQUESTS , content , filename , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 429 Too Many Requests result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result tooManyRequests ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 429 Too Many Requests result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result tooManyRequests ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 431 Request Header Fields Too Large result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result requestHeaderFieldsTooLarge ( Content content , String charset ) { } }

implementation: return status ( REQUEST_HEADER_FIELDS_TOO_LARGE , content , charset ) ;


signature:
public class Results { /** * Generates a 431 Request Header Fields Too Large result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result requestHeaderFieldsTooLarge ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( REQUEST_HEADER_FIELDS_TOO_LARGE , content , encoding ) ;


signature:
public class Results { /** * Generates a 431 Request Header Fields Too Large result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result requestHeaderFieldsTooLarge ( File content , boolean inline ) { } }

implementation: return requestHeaderFieldsTooLarge ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 431 Request Header Fields Too Large result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result requestHeaderFieldsTooLarge ( File content , String filename ) { } }

implementation: return requestHeaderFieldsTooLarge ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 431 Request Header Fields Too Large result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result requestHeaderFieldsTooLarge ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 431 Request Header Fields Too Large result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result requestHeaderFieldsTooLarge ( Path content , boolean inline , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( REQUEST_HEADER_FIELDS_TOO_LARGE , content , inline , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 431 Request Header Fields Too Large result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result requestHeaderFieldsTooLarge ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 500 Internal Server Error result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result internalServerError ( String content , String charset ) { } }

implementation: return status ( INTERNAL_SERVER_ERROR , content , charset ) ;


signature:
public class Results { /** * Generates a 500 Internal Server Error result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result internalServerError ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( INTERNAL_SERVER_ERROR , content , encoding ) ;


signature:
public class Results { /** * Generates a 500 Internal Server Error result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result internalServerError ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( INTERNAL_SERVER_ERROR , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 500 Internal Server Error result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result internalServerError ( File content , boolean inline ) { } }

implementation: return internalServerError ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 500 Internal Server Error result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result internalServerError ( File content , String filename ) { } }

implementation: return internalServerError ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 500 Internal Server Error result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result internalServerError ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 500 Internal Server Error result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result internalServerError ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 511 Network Authentication Required result .
 * @ param content the HTTP response body
 * @ param charset the charset into which the content should be encoded ( e . g . " UTF - 8 " )
 * @ return the result */
public static Result networkAuthenticationRequired ( Content content , String charset ) { } }

implementation: return status ( NETWORK_AUTHENTICATION_REQUIRED , content , charset ) ;


signature:
public class Results { /** * Generates a 511 Network Authentication Required result .
 * @ param content the result ' s body content as a play - json object
 * @ param encoding the encoding into which the json should be encoded
 * @ return the result */
public static Result networkAuthenticationRequired ( JsonNode content , JsonEncoding encoding ) { } }

implementation: return status ( NETWORK_AUTHENTICATION_REQUIRED , content , encoding ) ;


signature:
public class Results { /** * Generates a 511 Network Authentication Required result .
 * @ param content The file to send .
 * @ param fileMimeTypes Used for file type mapping .
 * @ return the result */
public static Result networkAuthenticationRequired ( File content , FileMimeTypes fileMimeTypes ) { } }

implementation: return status ( NETWORK_AUTHENTICATION_REQUIRED , content , fileMimeTypes ) ;


signature:
public class Results { /** * Generates a 511 Network Authentication Required result .
 * @ param content The file to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result networkAuthenticationRequired ( File content , boolean inline ) { } }

implementation: return networkAuthenticationRequired ( content , inline , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 511 Network Authentication Required result .
 * @ param content The file to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result networkAuthenticationRequired ( File content , String filename ) { } }

implementation: return networkAuthenticationRequired ( content , filename , StaticFileMimeTypes . fileMimeTypes ( ) ) ;


signature:
public class Results { /** * Generates a 511 Network Authentication Required result .
 * @ param content The path to send .
 * @ param inline Whether the file should be sent inline , or as an attachment .
 * @ return the result */
public static Result networkAuthenticationRequired ( Path content , boolean inline ) { } }


signature:
public class Results { /** * Generates a 511 Network Authentication Required result .
 * @ param content The path to send .
 * @ param filename The name to send the file as .
 * @ return the result */
public static Result networkAuthenticationRequired ( Path content , String filename ) { } }


signature:
public class Results { /** * Generates a 301 Moved Permanently result .
 * @ param url The url to redirect .
 * @ return the result */
public static Result movedPermanently ( String url ) { } }

implementation: return new Result ( MOVED_PERMANENTLY , Collections . singletonMap ( LOCATION , url ) ) ;


signature:
public class Results { /** * Generates a 301 Moved Permanently result .
 * @ param call Call defining the url to redirect ( typically comes from reverse router ) .
 * @ return the result */
public static Result movedPermanently ( Call call ) { } }

implementation: return new Result ( MOVED_PERMANENTLY , Collections . singletonMap ( LOCATION , call . path ( ) ) ) ;


signature:
public class Results { /** * Generates a 302 Found result .
 * @ param url The url to redirect .
 * @ return the result */
public static Result found ( String url ) { } }

implementation: return new Result ( FOUND , Collections . singletonMap ( LOCATION , url ) ) ;


signature:
public class Results { /** * Generates a 302 Found result .
 * @ param call Call defining the url to redirect ( typically comes from reverse router ) .
 * @ return the result */
public static Result found ( Call call ) { } }

implementation: return new Result ( FOUND , Collections . singletonMap ( LOCATION , call . path ( ) ) ) ;


signature:
public class Results { /** * Generates a 303 See Other result .
 * @ param url The url to redirect .
 * @ return the result */
public static Result seeOther ( String url ) { } }

implementation: return new Result ( SEE_OTHER , Collections . singletonMap ( LOCATION , url ) ) ;


signature:
public class Results { /** * Generates a 303 See Other result .
 * @ param url The url to redirect .
 * @ return the result */
public static Result redirect ( String url ) { } }


signature:
public class Results { /** * Generates a 303 See Other result .
 * @ param call Call defining the url to redirect ( typically comes from reverse router ) .
 * @ return the result */
public static Result redirect ( Call call ) { } }

implementation: return new Result ( SEE_OTHER , Collections . singletonMap ( LOCATION , call . path ( ) ) ) ;


signature:
public class Results { /** * Generates a 307 Temporary Redirect result .
 * @ param url The url to redirect .
 * @ return the result */
public static Result temporaryRedirect ( String url ) { } }

implementation: return new Result ( TEMPORARY_REDIRECT , Collections . singletonMap ( LOCATION , url ) ) ;


signature:
public class Results { /** * Generates a 307 Temporary Redirect result .
 * @ param call Call defining the url to redirect ( typically comes from reverse router ) .
 * @ return the result */
public static Result temporaryRedirect ( Call call ) { } }

implementation: return new Result ( TEMPORARY_REDIRECT , Collections . singletonMap ( LOCATION , call . path ( ) ) ) ;


signature:
public class Results { /** * Generates a 308 Permanent Redirect result .
 * @ param url The url to redirect .
 * @ return the result */
public static Result permanentRedirect ( String url ) { } }

implementation: return new Result ( PERMANENT_REDIRECT , Collections . singletonMap ( LOCATION , url ) ) ;


signature:
public class Results { /** * Generates a 308 Permanent Redirect result .
 * @ param call Call defining the url to redirect ( typically comes from reverse router ) .
 * @ return the result */
public static Result permanentRedirect ( Call call ) { } }

implementation: return new Result ( PERMANENT_REDIRECT , Collections . singletonMap ( LOCATION , call . path ( ) ) ) ;


signature:
public class User { /** * # bind */
@ Override public User bind ( String key , String id ) { } }

implementation:
// findById meant to be lightweight operation
User user = findById ( Long . valueOf ( id ) ) ; if ( user == null ) { throw new IllegalArgumentException ( "User with id " + id + " not found" ) ; } return user ;


signature:
public class User { /** * designed to be lightweight operation */
private User findById ( Long id ) { } }

implementation: if ( id > 3 ) return null ; User user = new User ( ) ; user . id = id ; user . name = "User " + String . valueOf ( id ) ; return user ;


signature:
public class Langs { /** * Select a preferred language , given the list of candidates .
 * < p > Will select the preferred language , based on what languages are available , or return the
 * default language if none of the candidates are available .
 * @ param candidates The candidate languages
 * @ return The preferred language */
public Lang preferred ( Collection < Lang > candidates ) { } }

implementation: return new Lang ( langs . preferred ( ( scala . collection . immutable . Seq ) Scala . asScala ( candidates ) . toSeq ( ) ) ) ;


signature:
public class Call { /** * Append a unique identifier to the URL .
 * @ return a copy if this call with a unique identifier to this url */
public Call unique ( ) { } }

implementation: return new play . api . mvc . Call ( method ( ) , this . uniquify ( this . url ( ) ) , fragment ( ) ) ;


signature:
public class Call { /** * Returns a new Call with the given fragment .
 * @ param fragment the URL fragment
 * @ return a copy of this call that contains the fragment */
public Call withFragment ( String fragment ) { } }

implementation: return new play . api . mvc . Call ( method ( ) , url ( ) , fragment ) ;


signature:
public class Call { /** * Transform this call to an absolute URL .
 * @ param request used to identify the host and protocol that should base this absolute URL
 * @ return the absolute URL string */
public String absoluteURL ( Http . Request request ) { } }

implementation: return absoluteURL ( request . secure ( ) , request . host ( ) ) ;


signature:
public class Call { /** * Transform this call to an WebSocket URL .
 * @ param request used as the base for forming the WS url
 * @ return the websocket url string */
public String webSocketURL ( Http . Request request ) { } }

implementation: return webSocketURL ( request . secure ( ) , request . host ( ) ) ;


signature:
public class DefaultDatabase { /** * Create a Scala function wrapper for ConnectionRunnable .
 * @ param block a Java functional interface instance to wrap
 * @ return a scala function that wraps the given block */
AbstractFunction1 < Connection , BoxedUnit > connectionFunction ( final ConnectionRunnable block ) { } }

implementation: return new AbstractFunction1 < Connection , BoxedUnit > ( ) { public BoxedUnit apply ( Connection connection ) { try { block . run ( connection ) ; return BoxedUnit . UNIT ; } catch ( java . sql . SQLException e ) { throw new RuntimeException ( "Connection runnable failed" , e ) ; } } } ;


signature:
public class DefaultDatabase { /** * Create a Scala function wrapper for ConnectionCallable .
 * @ param block a Java functional interface instance to wrap
 * @ param < A > the provided block ' s return type
 * @ return a scala function wrapping the given block */
< A > AbstractFunction1 < Connection , A > connectionFunction ( final ConnectionCallable < A > block ) { } }

implementation: return new AbstractFunction1 < Connection , A > ( ) { public A apply ( Connection connection ) { try { return block . call ( connection ) ; } catch ( java . sql . SQLException e ) { throw new RuntimeException ( "Connection callable failed" , e ) ; } } } ;


signature:
public class Application { /** * # show - page - action */
public Result show ( String page ) { } }

implementation: String content = Page . getContentOf ( page ) ; return ok ( content ) . as ( "text/html" ) ;


signature:
public class Server { /** * Create a server for the given router .
 * < p > The server will be running on a randomly selected ephemeral port , which can be checked using
 * the httpPort property .
 * < p > The server will be running in TEST mode .
 * @ param block The block that creates the router .
 * @ return The running server . */
public static Server forRouter ( Function < BuiltInComponents , Router > block ) { } }

implementation: return forRouter ( Mode . TEST , 0 , block ) ;


signature:
public class Server { /** * Create a server for the given router .
 * < p > The server will be running on a randomly selected ephemeral port , which can be checked using
 * the httpPort property .
 * < p > The server will be running in TEST mode .
 * @ param mode The mode the server will run on .
 * @ param block The block that creates the router .
 * @ return The running server . */
public static Server forRouter ( Mode mode , Function < BuiltInComponents , Router > block ) { } }

implementation: return forRouter ( mode , 0 , block ) ;


signature:
public class Server { /** * Create a server for the router returned by the given block .
 * @ param block The block which creates a router .
 * @ param mode The mode the server will run on .
 * @ param port The port the server will run on .
 * @ return The running server . */
public static Server forRouter ( Mode mode , int port , Function < BuiltInComponents , Router > block ) { } }

implementation: return new Builder ( ) . mode ( mode ) . http ( port ) . build ( block ) ;


signature:
public class Application { /** * # javascript - router - resource */
public Result javascriptRoutes2 ( Http . Request request ) { } }

implementation:
return ok ( // # javascript - router - resource - custom - method
JavaScriptReverseRouter . create ( "jsRoutes" , "myAjaxMethod" , request . host ( ) , routes . javascript . Users . list ( ) , routes . javascript . Users . get ( ) ) // # javascript - router - resource - custom - method
) . as ( Http . MimeTypes . JAVASCRIPT ) ;


signature:
public class Json { /** * Converts an object to JsonNode .
 * @ param data Value to convert in Json .
 * @ return the JSON node . */
public static JsonNode toJson ( final Object data ) { } }

implementation: try { return mapper ( ) . valueToTree ( data ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }


signature:
public class Json { /** * Converts a JsonNode to a Java value
 * @ param < A > the type of the return value .
 * @ param json Json value to convert .
 * @ param clazz Expected Java value type .
 * @ return the return value . */
public static < A > A fromJson ( JsonNode json , Class < A > clazz ) { } }

implementation: try { return mapper ( ) . treeToValue ( json , clazz ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }


signature:
public class Json { /** * Parses a String representing a json , and return it as a JsonNode .
 * @ param src the JSON string .
 * @ return the JSON node . */
public static JsonNode parse ( String src ) { } }

implementation: try { return mapper ( ) . readTree ( src ) ; } catch ( Throwable t ) { throw new RuntimeException ( t ) ; }


signature:
public class Json { /** * Parses a InputStream representing a json , and return it as a JsonNode .
 * @ param src the JSON input stream .
 * @ return the JSON node . */
public static JsonNode parse ( java . io . InputStream src ) { } }


signature:
public class DefaultCookieSigner { /** * Signs the given String using the given key . < br >
 * @ param message The message to sign .
 * @ param key The private key to sign with .
 * @ return A hexadecimal encoded signature . */
@ Override public String sign ( String message , byte [ ] key ) { } }

implementation: return signer . sign ( message , key ) ;


signature:
public class JavaScriptReverseRouter { /** * Generates a JavaScript reverse router .
 * @ param name the router ' s name
 * @ param ajaxMethod which asynchronous call method the user ' s browser will use ( e . g .
 * " jQuery . ajax " )
 * @ param host the host to use for the reverse route
 * @ param routes the reverse routes for this router
 * @ return the router */
public static JavaScript create ( String name , String ajaxMethod , String host , JavaScriptReverseRoute ... routes ) { } }

implementation: return play . api . routing . JavaScriptReverseRouter . apply ( name , Scala . Option ( ajaxMethod ) , host , Scala . varargs ( routes ) ) ;


signature:
public class JavaScriptReverseRouter { /** * Generates a JavaScript reverse router .
 * @ param name the router ' s name
 * @ param ajaxMethod which asynchronous call method the user ' s browser will use ( e . g .
 * " jQuery . ajax " )
 * @ param routes the reverse routes for this router
 * @ return the router
 * @ deprecated Deprecated as of 2.7.0 . Use { @ link # create ( String , String , String ,
 * JavaScriptReverseRoute . . . ) } instead . */
@ Deprecated public static JavaScript create ( String name , String ajaxMethod , JavaScriptReverseRoute ... routes ) { } }

implementation: return create ( name , ajaxMethod , play . mvc . Http . Context . current ( ) . request ( ) . host ( ) , routes ) ;


signature:
public class JavaScriptReverseRouter { /** * Generates a JavaScript reverse router .
 * @ param name the router ' s name
 * @ param routes the reverse routes for this router
 * @ return the router
 * @ deprecated Deprecated as of 2.7.0 . Use { @ link # create ( String , String , String ,
 * JavaScriptReverseRoute . . . ) } instead . */
@ Deprecated public static JavaScript create ( String name , JavaScriptReverseRoute ... routes ) { } }

implementation: return create ( name , "jQuery.ajax" , routes ) ;


signature:
public class AnnotationUtils { /** * Returns a new array whose entries do not contain container annotations anymore but the
 * indirectly present annotation ( s ) a container annotation was wrapping instead . An annotation is
 * considered a container annotation if its indirectly present annotation ( s ) are annotated with
 * { @ link Repeatable } . Annotations inside the given array which don ' t meet the above definition of
 * a container annotations will be returned untouched .
 * @ param annotations An array of annotations to unwrap . Can contain both container and non
 * container annotations .
 * @ return A new array without container annotations but the container annotations ' indirectly
 * defined annotations . */
public static < A extends Annotation > Annotation [ ] unwrapContainerAnnotations ( final A [ ] annotations ) { } }

implementation:
final List < Annotation > unwrappedAnnotations = new LinkedList < > ( ) ; for ( final Annotation maybeContainerAnnotation : annotations ) { final List < Annotation > indirectlyPresentAnnotations = getIndirectlyPresentAnnotations ( maybeContainerAnnotation ) ; if ( ! indirectlyPresentAnnotations . isEmpty ( ) ) { unwrappedAnnotations . addAll ( indirectlyPresentAnnotations ) ; } else { unwrappedAnnotations . add ( maybeContainerAnnotation ) ; // was not a container annotation
} } return unwrappedAnnotations . toArray ( new Annotation [ unwrappedAnnotations . size ( ) ] ) ;


signature:
public class AnnotationUtils { /** * If the return type of an existing { @ code value ( ) } method of the passed annotation is an { @ code
 * Annotation [ ] } array and the annotations inside that { @ code Annotation [ ] } array are annotated
 * with the { @ link Repeatable } annotation the annotations of that array will be returned . If the
 * passed annotation does not have a { @ code value ( ) } method or the above criteria are not met an
 * empty list will be returned instead .
 * @ param maybeContainerAnnotation The annotation which { @ code value ( ) } method will be checked for
 * other annotations
 * @ return The annotations defined by the { @ code value ( ) } method or an empty list . */
public static < A extends Annotation > List < Annotation > getIndirectlyPresentAnnotations ( final A maybeContainerAnnotation ) { } }

implementation:
try { final Method method = maybeContainerAnnotation . annotationType ( ) . getMethod ( "value" ) ; final Object o = method . invoke ( maybeContainerAnnotation ) ; if ( Annotation [ ] . class . isAssignableFrom ( o . getClass ( ) ) ) { final Annotation [ ] indirectAnnotations = ( Annotation [ ] ) o ; if ( indirectAnnotations . length > 0 && indirectAnnotations [ 0 ] . annotationType ( ) . isAnnotationPresent ( Repeatable . class ) ) { return Arrays . asList ( indirectAnnotations ) ; } } } catch ( final NoSuchMethodException e ) { // That ' s ok , this just wasn ' t a container annotation - > continue
} catch ( final SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { throw new IllegalStateException ( e ) ; } return Collections . emptyList ( ) ;


signature:
public class Paths { /** * Create a path to targetPath that ' s relative to the given startPath . */
public static String relative ( String startPath , String targetPath ) { } }

implementation:
// If the start and target path ' s are the same then link to the current directory
if ( startPath . equals ( targetPath ) ) { return CURRENT_DIR ; } String [ ] start = toSegments ( canonical ( startPath ) ) ; String [ ] target = toSegments ( canonical ( targetPath ) ) ; // If start path has no trailing separator ( a " file " path ) , then drop file segment
if ( ! startPath . endsWith ( SEPARATOR ) ) start = Arrays . copyOfRange ( start , 0 , start . length - 1 ) ; // If target path has no trailing separator , then drop file segment , but keep a reference to add
// it later
String targetFile = "" ; if ( ! targetPath . endsWith ( SEPARATOR ) ) { targetFile = target [ target . length - 1 ] ; target = Arrays . copyOfRange ( target , 0 , target . length - 1 ) ; } // Work out how much of the filepath is shared by start and path .
String [ ] common = commonPrefix ( start , target ) ; String [ ] parents = toParentDirs ( start . length - common . length ) ; int relativeStartIdx = common . length ; String [ ] relativeDirs = Arrays . copyOfRange ( target , relativeStartIdx , target . length ) ; String [ ] relativePath = Arrays . copyOf ( parents , parents . length + relativeDirs . length ) ; System . arraycopy ( relativeDirs , 0 , relativePath , parents . length , relativeDirs . length ) ; // If this is not a sibling reference append a trailing / to path
String trailingSep = "" ; if ( relativePath . length > 0 ) trailingSep = SEPARATOR ; return Arrays . stream ( relativePath ) . collect ( Collectors . joining ( SEPARATOR ) ) + trailingSep + targetFile ;


signature:
public class Paths { /** * Create a canonical path that does not contain parent directories , current directories , or
 * superfluous directory separators . */
public static String canonical ( String url ) { } }

implementation: String [ ] urlPath = toSegments ( url ) ; Stack < String > canonical = new Stack < > ( ) ; for ( String comp : urlPath ) { if ( comp . isEmpty ( ) || comp . equals ( CURRENT_DIR ) ) continue ; if ( ! comp . equals ( PARENT_DIR ) || ( ! canonical . empty ( ) && canonical . peek ( ) . equals ( PARENT_DIR ) ) ) canonical . push ( comp ) ; else canonical . pop ( ) ; } String prefixSep = url . startsWith ( SEPARATOR ) ? SEPARATOR : "" ; String trailingSep = url . endsWith ( SEPARATOR ) ? SEPARATOR : "" ; return prefixSep + canonical . stream ( ) . collect ( Collectors . joining ( SEPARATOR ) ) + trailingSep ;


signature:
public class HelloController { /** * # hello - world - hello - correct - action */
public Result hello ( String name ) { } }

implementation:
// # # # replace : return ok ( views . html . hello . render ( name ) ) ;
return ok ( javaguide . hello . html . helloName . render ( name ) ) ;


signature:
public class Constraints { /** * Converts a set of constraints to human - readable values . Does not guarantee the order of the
 * returned constraints .
 * < p > This method calls { @ code displayableConstraint } under the hood .
 * @ param constraints the set of constraint descriptors .
 * @ return a list of pairs of tuples assembled from displayableConstraint . */
public static List < Tuple < String , List < Object > > > displayableConstraint ( Set < ConstraintDescriptor < ? > > constraints ) { } }

implementation: return constraints . parallelStream ( ) . filter ( c -> c . getAnnotation ( ) . annotationType ( ) . isAnnotationPresent ( Display . class ) ) . map ( c -> displayableConstraint ( c ) ) . collect ( Collectors . toList ( ) ) ;


signature:
public class Constraints { /** * Converts a set of constraints to human - readable values in guaranteed order . Only constraints
 * that have an annotation that intersect with the { @ code orderedAnnotations } parameter will be
 * considered . The order of the returned constraints corresponds to the order of the { @ code
 * orderedAnnotations parameter } .
 * @ param constraints the set of constraint descriptors .
 * @ param orderedAnnotations the array of annotations
 * @ return a list of tuples showing readable constraints . */
public static List < Tuple < String , List < Object > > > displayableConstraint ( Set < ConstraintDescriptor < ? > > constraints , Annotation [ ] orderedAnnotations ) { } }

implementation:
final List < Annotation > constraintAnnot = constraints . stream ( ) . map ( c -> c . getAnnotation ( ) ) . collect ( Collectors . < Annotation > toList ( ) ) ; return Stream . of ( orderedAnnotations ) . filter ( constraintAnnot :: contains ) // only use annotations for which we actually have a constraint
. filter ( a -> a . annotationType ( ) . isAnnotationPresent ( Display . class ) ) . map ( a -> displayableConstraint ( constraints . parallelStream ( ) . filter ( c -> c . getAnnotation ( ) . equals ( a ) ) . findFirst ( ) . get ( ) ) ) . collect ( Collectors . toList ( ) ) ;


signature:
public class Constraints { /** * Converts a constraint to a human - readable value .
 * @ param constraint the constraint descriptor .
 * @ return A tuple containing the constraint ' s display name and the constraint attributes . */
public static Tuple < String , List < Object > > displayableConstraint ( ConstraintDescriptor < ? > constraint ) { } }

implementation: final Display displayAnnotation = constraint . getAnnotation ( ) . annotationType ( ) . getAnnotation ( Display . class ) ; return Tuple ( displayAnnotation . name ( ) , Collections . unmodifiableList ( Stream . of ( displayAnnotation . attributes ( ) ) . map ( attr -> constraint . getAttributes ( ) . get ( attr ) ) . collect ( Collectors . toList ( ) ) ) ) ;


signature:
public class JPARepositoryMethods { /** * # jpa - withTransaction - function */
public CompletionStage < Long > runningWithTransaction ( ) { } }

implementation:
return CompletableFuture . supplyAsync ( ( ) -> { // lambda is an instance of Function < EntityManager , Long >
return jpaApi . withTransaction ( entityManager -> { Query query = entityManager . createNativeQuery ( "select max(age) from people" ) ; return ( Long ) query . getSingleResult ( ) ; } ) ; } , executionContext ) ;


signature:
public class JPARepositoryMethods { /** * # jpa - withTransaction - consumer */
public CompletionStage < Void > runningWithRunnable ( ) { } }

implementation:
// lambda is an instance of Consumer < EntityManager >
return CompletableFuture . runAsync ( ( ) -> { jpaApi . withTransaction ( entityManager -> { Query query = entityManager . createNativeQuery ( "update people set active = 1 where age > 18" ) ; query . executeUpdate ( ) ; } ) ; } , executionContext ) ;


signature:
public class DefaultFutures { /** * Creates a CompletionStage that returns either the input stage , or a futures .
 * < p > Note that timeout is not the same as cancellation . Even in case of futures , the given
 * completion stage will still complete , even though that completed value is not returned .
 * @ param stage the input completion stage that may time out .
 * @ param amount The amount ( expressed with the corresponding unit ) .
 * @ param unit The time Unit .
 * @ param < A > the completion ' s result type .
 * @ return either the completed future , or a completion stage that failed with futures . */
@ Override public < A > CompletionStage < A > timeout ( final CompletionStage < A > stage , final long amount , final TimeUnit unit ) { } }

implementation: requireNonNull ( stage , "Null stage" ) ; requireNonNull ( unit , "Null unit" ) ; FiniteDuration duration = FiniteDuration . apply ( amount , unit ) ; return toJava ( delegate . timeout ( duration , Scala . asScalaWithFuture ( ( ) -> stage ) ) ) ;


signature:
public class DefaultFutures { /** * An alias for futures ( stage , delay , unit ) that uses a java . time . Duration .
 * @ param stage the input completion stage that may time out .
 * @ param duration The duration after which there is a timeout .
 * @ param < A > the completion stage that should be wrapped with a future .
 * @ return the completion stage , or a completion stage that failed with futures . */
@ Override public < A > CompletionStage < A > timeout ( final CompletionStage < A > stage , final Duration duration ) { } }

implementation: requireNonNull ( stage , "Null stage" ) ; requireNonNull ( duration , "Null duration" ) ; FiniteDuration finiteDuration = FiniteDuration . apply ( duration . toMillis ( ) , TimeUnit . MILLISECONDS ) ; return toJava ( delegate . timeout ( finiteDuration , Scala . asScalaWithFuture ( ( ) -> stage ) ) ) ;


signature:
public class DefaultFutures { /** * Create a CompletionStage which , after a delay , will be redeemed with the result of a given
 * supplier . The supplier will be called after the delay .
 * @ param callable the input completion stage that is delayed .
 * @ param amount The time to wait .
 * @ param unit The units to use for the amount .
 * @ param < A > the type of the completion ' s result .
 * @ return the delayed CompletionStage wrapping supplier . */
@ Override public < A > CompletionStage < A > delayed ( final Callable < CompletionStage < A > > callable , long amount , TimeUnit unit ) { } }

implementation: requireNonNull ( callable , "Null callable" ) ; requireNonNull ( amount , "Null amount" ) ; requireNonNull ( unit , "Null unit" ) ; FiniteDuration duration = FiniteDuration . apply ( amount , unit ) ; return toJava ( delegate . delayed ( duration , Scala . asScalaWithFuture ( callable ) ) ) ;