Package io.smooch.core
Class SmoochCallback.Response.Builder<T>
- java.lang.Object
-
- io.smooch.core.SmoochCallback.Response.Builder<T>
-
- Type Parameters:
T
- the type of the resulting data from the action being performed
- Enclosing class:
- SmoochCallback.Response<T>
public static class SmoochCallback.Response.Builder<T> extends java.lang.Object
Builder for creating instances ofSmoochCallback.Response
with a status code and any additional information required for the callback being notified.
-
-
Constructor Summary
Constructors Constructor Description Builder(int status)
Constructs an instance of thisSmoochCallback.Response.Builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SmoochCallback.Response<T>
build()
Builds theSmoochCallback.Response
with the provided informationSmoochCallback.Response.Builder<T>
withData(T data)
Adds data to the response builderSmoochCallback.Response.Builder<T>
withError(java.lang.String error)
Adds an error message to the response builder
-
-
-
Constructor Detail
-
Builder
public Builder(int status)
Constructs an instance of thisSmoochCallback.Response.Builder
- Parameters:
status
- the status code of the action being performed
-
-
Method Detail
-
withError
public SmoochCallback.Response.Builder<T> withError(java.lang.String error)
Adds an error message to the response builder- Parameters:
error
- the error message to be added to theSmoochCallback.Response
- Returns:
- this
SmoochCallback.Response.Builder
-
withData
public SmoochCallback.Response.Builder<T> withData(T data)
Adds data to the response builder- Parameters:
data
- the data to be added to theSmoochCallback.Response
- Returns:
- this
SmoochCallback.Response.Builder
-
build
public SmoochCallback.Response<T> build()
Builds theSmoochCallback.Response
with the provided information- Returns:
- an instance of
SmoochCallback.Response
-
-