Class RatingDTO.Builder
- java.lang.Object
-
- com.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.RatingDTO.Builder
-
- Enclosing class:
- RatingDTO
public static class RatingDTO.Builder extends Object
Builder used to create a new immutableRatingDTO
implementation
This builder provides a fluent API for setting certain object properties and creating a new immutableRatingDTO
instance based on these properties. New builders may be initialized with some existing DTO instance, which presets the builders properties to the values of the given DTO, still retaining the option to make additional changes before actually building a new immutable object.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RatingDTO
build()
Builds a newRatingDTO
.RatingDTO.Builder
from(Rating instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Rating
instance.RatingDTO.Builder
from(RatingDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.RatingDTO
instance.RatingDTO.Builder
rating(Double rating)
Initializes the value for therating
attribute.RatingDTO.Builder
ratingItemId(Long ratingItemId)
Initializes the value for theratingItemId
attribute.RatingDTO.Builder
ratingType(String ratingType)
Initializes the value for theratingType
attribute.
-
-
-
Method Detail
-
from
public final RatingDTO.Builder from(Rating instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Rating
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final RatingDTO.Builder from(RatingDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.RatingDTO
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
rating
public final RatingDTO.Builder rating(@Nullable Double rating)
Initializes the value for therating
attribute.- Parameters:
rating
- The value for rating (can benull
)- Returns:
this
builder for use in a chained invocation
-
ratingItemId
public final RatingDTO.Builder ratingItemId(@Nullable Long ratingItemId)
Initializes the value for theratingItemId
attribute.- Parameters:
ratingItemId
- The value for ratingItemId (can benull
)- Returns:
this
builder for use in a chained invocation
-
ratingType
public final RatingDTO.Builder ratingType(@Nullable String ratingType)
Initializes the value for theratingType
attribute.- Parameters:
ratingType
- The value for ratingType (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public RatingDTO build()
Builds a newRatingDTO
.- Returns:
- An immutable instance of RatingDTO
- Throws:
IllegalStateException
- if any required attributes are missing
-
-