Class TextOutputLambdaResource
- java.lang.Object
-
- org.wicketstuff.rest.lambda.resource.TextOutputLambdaResource
-
- All Implemented Interfaces:
Serializable
,org.apache.wicket.request.resource.IResource
,org.apache.wicket.util.io.IClusterable
public class TextOutputLambdaResource extends Object implements org.apache.wicket.request.resource.IResource
IResource
that uses aFunction
to serve the request. The result of this function (a generic Object) is then written as string to the web response. A second function is provided to transform the result a textual representation.- Author:
- andrea
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
respond(org.apache.wicket.request.resource.IResource.Attributes attributes)
-
-
-
Constructor Detail
-
TextOutputLambdaResource
public TextOutputLambdaResource(Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputTextFunction)
Build a new resource using the two provided functions.- Parameters:
respondFunction
- the function used to respond requestsoutputTextFunction
- the function used to convert the respond result to text.
-
-