Class ReservationBuilder
java.lang.Object
com.commercetools.history.models.common.ReservationBuilder
- All Implemented Interfaces:
Builder<Reservation>
ReservationBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Reservation reservation = Reservation.builder()
.quantity(1)
.owner(ownerBuilder -> ownerBuilder)
.createdAt("{createdAt}")
.checkoutStartedAt("{checkoutStartedAt}")
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds Reservation with checking for non-null required valuesbuilds Reservation without checking for non-null required valuescheckoutStartedAt(String checkoutStartedAt) set the value to the checkoutStartedAtset the value to the createdAtvalue of checkoutStartedAt}value of createdAt}getOwner()value of owner}value of quantity}static ReservationBuilderof()factory method for an instance of ReservationBuilderstatic ReservationBuilderof(Reservation template) create builder for Reservation instanceset the value to the ownerowner(Function<ReferenceBuilder, ReferenceBuilder> builder) set the value to the owner using the builder functionset the value to the quantitywithOwner(Function<ReferenceBuilder, Reference> builder) set the value to the owner using the builder function
-
Constructor Details
-
ReservationBuilder
public ReservationBuilder()
-
-
Method Details
-
quantity
set the value to the quantity- Parameters:
quantity- value to be set- Returns:
- Builder
-
owner
set the value to the owner using the builder function- Parameters:
builder- function to build the owner value- Returns:
- Builder
-
withOwner
set the value to the owner using the builder function- Parameters:
builder- function to build the owner value- Returns:
- Builder
-
owner
set the value to the owner- Parameters:
owner- value to be set- Returns:
- Builder
-
createdAt
set the value to the createdAt- Parameters:
createdAt- value to be set- Returns:
- Builder
-
checkoutStartedAt
set the value to the checkoutStartedAt- Parameters:
checkoutStartedAt- value to be set- Returns:
- Builder
-
getQuantity
value of quantity}- Returns:
- quantity
-
getOwner
value of owner}- Returns:
- owner
-
getCreatedAt
value of createdAt}- Returns:
- createdAt
-
getCheckoutStartedAt
value of checkoutStartedAt}- Returns:
- checkoutStartedAt
-
build
builds Reservation with checking for non-null required values- Specified by:
buildin interfaceBuilder<Reservation>- Returns:
- Reservation
-
buildUnchecked
builds Reservation without checking for non-null required values- Returns:
- Reservation
-
of
factory method for an instance of ReservationBuilder- Returns:
- builder
-
of
create builder for Reservation instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-