Class GenericSingleValuedReponse.Builder<T>
- java.lang.Object
-
- com.anaptecs.jeaf.junit.rest.generics.AbstractResponse.Builder<T>
-
- com.anaptecs.jeaf.junit.rest.generics.GenericSingleValuedReponse.Builder<T>
-
- Enclosing class:
- GenericSingleValuedReponse<T>
public static class GenericSingleValuedReponse.Builder<T> extends AbstractResponse.Builder<T>
Class implements builder to create a new instance of classGenericSingleValuedReponse.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()UseGenericSingleValuedReponse.builder()instead of private constructor to create new builder.protectedBuilder(GenericSingleValuedReponse<T> pObject)UseGenericSingleValuedReponse.builder(GenericSingleValuedReponse)instead of private constructor to create new builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericSingleValuedReponse<T>build()Method creates a new instance of class GenericSingleValuedReponse.GenericSingleValuedReponse<T>buildValidated()Method creates a new validated instance of class GenericSingleValuedReponse.GenericSingleValuedReponse.Builder<T>setErrors(java.util.List<Message> pErrors)Method sets associationAbstractResponse.errors.GenericSingleValuedReponse.Builder<T>setValue(T pValue)Method sets attributevalue.GenericSingleValuedReponse.Builder<T>setWarnings(java.util.List<Message> pWarnings)Method sets associationAbstractResponse.warnings.
-
-
-
Constructor Detail
-
Builder
protected Builder()
UseGenericSingleValuedReponse.builder()instead of private constructor to create new builder.
-
Builder
protected Builder(GenericSingleValuedReponse<T> pObject)
UseGenericSingleValuedReponse.builder(GenericSingleValuedReponse)instead of private constructor to create new builder.
-
-
Method Detail
-
setErrors
public GenericSingleValuedReponse.Builder<T> setErrors(java.util.List<Message> pErrors)
Method sets associationAbstractResponse.errors.- Overrides:
setErrorsin classAbstractResponse.Builder<T>- Parameters:
pErrors- Collection to whichAbstractResponse.errorsshould be set.- Returns:
GenericSingleValuedReponse.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setWarnings
public GenericSingleValuedReponse.Builder<T> setWarnings(java.util.List<Message> pWarnings)
Method sets associationAbstractResponse.warnings.- Overrides:
setWarningsin classAbstractResponse.Builder<T>- Parameters:
pWarnings- Collection to whichAbstractResponse.warningsshould be set.- Returns:
GenericSingleValuedReponse.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setValue
public GenericSingleValuedReponse.Builder<T> setValue(T pValue)
Method sets attributevalue.- Parameters:
pValue- Value to whichvalueshould be set.- Returns:
GenericSingleValuedReponse.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
build
public GenericSingleValuedReponse<T> build()
Method creates a new instance of class GenericSingleValuedReponse. The object will be initialized with the values of the builder.- Returns:
- GenericSingleValuedReponse Created object. The method never returns null.
-
buildValidated
public GenericSingleValuedReponse<T> buildValidated() throws javax.validation.ConstraintViolationException
Method creates a new validated instance of class GenericSingleValuedReponse. The object will be initialized with the values of the builder and validated afterwards.- Returns:
- GenericSingleValuedReponse Created and validated object. The method never returns null.
- Throws:
javax.validation.ConstraintViolationException- in case that one or more validations for the created object failed.
-
-