Package com.attribyte.parser.model
Class Video
java.lang.Object
com.attribyte.parser.model.Video
An immutable video.
- Author:
- Matt Hamer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringText that describes the video, or an empty string if none.final AspectThe aspect.final intThe video bitrate.final longThe duration in milliseconds.final intThe video height or0if unknown.final StringA unique id, or an empty string if none.final ImageAn image representing the video.final StringA link to the video.final StringThe video type or an empty string if none.final StringA title for the video, or an empty string if none.final com.google.common.collect.ImmutableList<Video> Variants of this video.final intThe video width or0if unknown. -
Method Summary
Modifier and TypeMethodDescriptionstatic Video.BuilderCreates a builder from an existing video.static Video.BuilderCreates a builder.booleaninthashCode()toString()withNewLink(String link) Creates a copy of this video with a new link.withNewLink(String link, String mediaType) Creates a copy of this video with a new link and media type.withNewLink(String link, String mediaType, int bitrate) Creates a copy of this video with a new link, media type and bitreate.withVariants(Collection<Video> variants) Creates a copy of this video with variants.
-
Field Details
-
id
A unique id, or an empty string if none. -
link
A link to the video. Nevernullor empty. -
altText
Text that describes the video, or an empty string if none. -
title
A title for the video, or an empty string if none. -
width
public final int widthThe video width or0if unknown. -
height
public final int heightThe video height or0if unknown. -
mediaType
The video type or an empty string if none. -
bitrate
public final int bitrateThe video bitrate. -
durationMillis
public final long durationMillisThe duration in milliseconds. -
aspect
The aspect. -
image
An image representing the video. -
variants
Variants of this video.
-
-
Method Details
-
builder
Creates a builder.- Parameters:
link- The required link.- Returns:
- The builder.
- Throws:
UnsupportedOperationException- If the specified link isnullor empty.
-
builder
Creates a builder from an existing video.- Parameters:
video- The video.- Returns:
- The builder initialized from the existing video.
-
withNewLink
Creates a copy of this video with a new link.- Parameters:
link- The new link.- Returns:
- The new video.
- Throws:
UnsupportedOperationException- If the specified link isnullor empty.
-
withNewLink
Creates a copy of this video with a new link and media type.- Parameters:
link- The new link.mediaType- The new media type.- Returns:
- The new video.
- Throws:
UnsupportedOperationException- If the specified link isnullor empty.
-
withNewLink
public Video withNewLink(String link, String mediaType, int bitrate) throws UnsupportedOperationException Creates a copy of this video with a new link, media type and bitreate.- Parameters:
link- The new link.mediaType- The new media type.bitrate- The new bitrate.- Returns:
- The new video.
- Throws:
UnsupportedOperationException- If the specified link isnullor empty.
-
withVariants
Creates a copy of this video with variants.- Parameters:
variants- The variants.- Returns:
- The new video.
-
toString
-
hashCode
public int hashCode() -
equals
-