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 immutableImageDTOimplementation
This builder provides a fluent API for setting certain object properties and creating a new immutableImageDTOinstance 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 ImageDTObuild()Builds a newImageDTO.ImageDTO.BuilderfileName(String fileName)Initializes the value for thefileNameattribute.ImageDTO.Builderfrom(Image instance)Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Imageinstance.ImageDTO.Builderfrom(ImageDTO instance)Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.ImageDTOinstance.ImageDTO.Builderid(Long id)Initializes the value for theidattribute.ImageDTO.BuilderkeyType(String keyType)Initializes the value for thekeyTypeattribute.ImageDTO.BuilderlanguageId(Long languageId)Initializes the value for thelanguageIdattribute.ImageDTO.BuilderputAllRatingsInfo(Map<String,? extends Object> entries)Put all mappings from the specified map as entries toratingsInfomap.ImageDTO.BuilderputRatingsInfo(String key, Object value)Put one entry to theratingsInfomap.ImageDTO.BuilderputRatingsInfo(Map.Entry<String,? extends Object> entry)Put one entry to theratingsInfomap.ImageDTO.BuilderratingsInfo(Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for theratingsInfomap.ImageDTO.Builderresolution(String resolution)Initializes the value for theresolutionattribute.ImageDTO.BuildersubKey(String subKey)Initializes the value for thesubKeyattribute.ImageDTO.Builderthumbnail(String thumbnail)Initializes the value for thethumbnailattribute.
-
-
-
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.ImageDTOinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder 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.Imageinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
fileName
public final ImageDTO.Builder fileName(@Nullable String fileName)
Initializes the value for thefileNameattribute.- Parameters:
fileName- The value for fileName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
id
public final ImageDTO.Builder id(@Nullable Long id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
keyType
public final ImageDTO.Builder keyType(@Nullable String keyType)
Initializes the value for thekeyTypeattribute.- Parameters:
keyType- The value for keyType (can benull)- Returns:
thisbuilder for use in a chained invocation
-
languageId
public final ImageDTO.Builder languageId(@Nullable Long languageId)
Initializes the value for thelanguageIdattribute.- Parameters:
languageId- The value for languageId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
resolution
public final ImageDTO.Builder resolution(@Nullable String resolution)
Initializes the value for theresolutionattribute.- Parameters:
resolution- The value for resolution (can benull)- Returns:
thisbuilder for use in a chained invocation
-
subKey
public final ImageDTO.Builder subKey(@Nullable String subKey)
Initializes the value for thesubKeyattribute.- Parameters:
subKey- The value for subKey (can benull)- Returns:
thisbuilder for use in a chained invocation
-
thumbnail
public final ImageDTO.Builder thumbnail(@Nullable String thumbnail)
Initializes the value for thethumbnailattribute.- Parameters:
thumbnail- The value for thumbnail (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putRatingsInfo
public final ImageDTO.Builder putRatingsInfo(String key, Object value)
Put one entry to theratingsInfomap.- Parameters:
key- The key in the ratingsInfo mapvalue- The associated value in the ratingsInfo map- Returns:
thisbuilder for use in a chained invocation
-
putRatingsInfo
public final ImageDTO.Builder putRatingsInfo(Map.Entry<String,? extends Object> entry)
Put one entry to theratingsInfomap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 theratingsInfomap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the ratingsInfo map- Returns:
thisbuilder 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 toratingsInfomap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the ratingsInfo map- Returns:
thisbuilder 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
-
-