Class ImageDTO.Builder
- java.lang.Object
-
- com.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.ImageDTO.Builder
-
- Enclosing class:
- ImageDTO
public static class ImageDTO.Builder extends Object
Builder used to create a new immutableImageDTO
implementation
This builder provides a fluent API for setting certain object properties and creating a new immutableImageDTO
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 ImageDTO
build()
Builds a newImageDTO
.ImageDTO.Builder
fileName(String fileName)
Initializes the value for thefileName
attribute.ImageDTO.Builder
from(Image instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Image
instance.ImageDTO.Builder
from(ImageDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.ImageDTO
instance.ImageDTO.Builder
id(Long id)
Initializes the value for theid
attribute.ImageDTO.Builder
keyType(String keyType)
Initializes the value for thekeyType
attribute.ImageDTO.Builder
languageId(Long languageId)
Initializes the value for thelanguageId
attribute.ImageDTO.Builder
putAllRatingsInfo(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries toratingsInfo
map.ImageDTO.Builder
putRatingsInfo(String key, Object value)
Put one entry to theratingsInfo
map.ImageDTO.Builder
putRatingsInfo(Map.Entry<String,? extends Object> entry)
Put one entry to theratingsInfo
map.ImageDTO.Builder
ratingsInfo(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for theratingsInfo
map.ImageDTO.Builder
resolution(String resolution)
Initializes the value for theresolution
attribute.ImageDTO.Builder
subKey(String subKey)
Initializes the value for thesubKey
attribute.ImageDTO.Builder
thumbnail(String thumbnail)
Initializes the value for thethumbnail
attribute.
-
-
-
Method Detail
-
from
public final ImageDTO.Builder from(ImageDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.ImageDTO
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final ImageDTO.Builder from(Image instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Image
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
fileName
public final ImageDTO.Builder fileName(@Nullable String fileName)
Initializes the value for thefileName
attribute.- Parameters:
fileName
- The value for fileName (can benull
)- Returns:
this
builder for use in a chained invocation
-
id
public final ImageDTO.Builder id(@Nullable Long id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
keyType
public final ImageDTO.Builder keyType(@Nullable String keyType)
Initializes the value for thekeyType
attribute.- Parameters:
keyType
- The value for keyType (can benull
)- Returns:
this
builder for use in a chained invocation
-
languageId
public final ImageDTO.Builder languageId(@Nullable Long languageId)
Initializes the value for thelanguageId
attribute.- Parameters:
languageId
- The value for languageId (can benull
)- Returns:
this
builder for use in a chained invocation
-
resolution
public final ImageDTO.Builder resolution(@Nullable String resolution)
Initializes the value for theresolution
attribute.- Parameters:
resolution
- The value for resolution (can benull
)- Returns:
this
builder for use in a chained invocation
-
subKey
public final ImageDTO.Builder subKey(@Nullable String subKey)
Initializes the value for thesubKey
attribute.- Parameters:
subKey
- The value for subKey (can benull
)- Returns:
this
builder for use in a chained invocation
-
thumbnail
public final ImageDTO.Builder thumbnail(@Nullable String thumbnail)
Initializes the value for thethumbnail
attribute.- Parameters:
thumbnail
- The value for thumbnail (can benull
)- Returns:
this
builder for use in a chained invocation
-
putRatingsInfo
public final ImageDTO.Builder putRatingsInfo(String key, Object value)
Put one entry to theratingsInfo
map.- Parameters:
key
- The key in the ratingsInfo mapvalue
- The associated value in the ratingsInfo map- Returns:
this
builder for use in a chained invocation
-
putRatingsInfo
public final ImageDTO.Builder putRatingsInfo(Map.Entry<String,? extends Object> entry)
Put one entry to theratingsInfo
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
ratingsInfo
public final ImageDTO.Builder ratingsInfo(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for theratingsInfo
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the ratingsInfo map- Returns:
this
builder for use in a chained invocation
-
putAllRatingsInfo
public final ImageDTO.Builder putAllRatingsInfo(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries toratingsInfo
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the ratingsInfo map- Returns:
this
builder for use in a chained invocation
-
build
public ImageDTO build()
Builds a newImageDTO
.- Returns:
- An immutable instance of ImageDTO
- Throws:
IllegalStateException
- if any required attributes are missing
-
-