Files
plexjava/src/main/java/dev/plexapi/sdk/models/operations/Part.java

587 lines
18 KiB
Java

/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.utils.LazySingletonValue;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
public class Part {
@JsonProperty("id")
private int id;
@JsonProperty("key")
private String key;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("duration")
private Optional<Integer> duration;
@JsonProperty("file")
private String file;
@JsonProperty("size")
private long size;
/**
* The container format of the media file.
*
*/
@JsonProperty("container")
private String container;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("audioProfile")
private Optional<String> audioProfile;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("has64bitOffsets")
private Optional<Boolean> has64bitOffsets;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("optimizedForStreaming")
private Optional<Boolean> optimizedForStreaming;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("videoProfile")
private Optional<String> videoProfile;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("indexes")
private Optional<String> indexes;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("hasThumbnail")
private Optional<? extends HasThumbnail> hasThumbnail;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("Stream")
private Optional<? extends List<Stream>> stream;
@JsonCreator
public Part(
@JsonProperty("id") int id,
@JsonProperty("key") String key,
@JsonProperty("duration") Optional<Integer> duration,
@JsonProperty("file") String file,
@JsonProperty("size") long size,
@JsonProperty("container") String container,
@JsonProperty("audioProfile") Optional<String> audioProfile,
@JsonProperty("has64bitOffsets") Optional<Boolean> has64bitOffsets,
@JsonProperty("optimizedForStreaming") Optional<Boolean> optimizedForStreaming,
@JsonProperty("videoProfile") Optional<String> videoProfile,
@JsonProperty("indexes") Optional<String> indexes,
@JsonProperty("hasThumbnail") Optional<? extends HasThumbnail> hasThumbnail,
@JsonProperty("Stream") Optional<? extends List<Stream>> stream) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(key, "key");
Utils.checkNotNull(duration, "duration");
Utils.checkNotNull(file, "file");
Utils.checkNotNull(size, "size");
Utils.checkNotNull(container, "container");
Utils.checkNotNull(audioProfile, "audioProfile");
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
Utils.checkNotNull(videoProfile, "videoProfile");
Utils.checkNotNull(indexes, "indexes");
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
Utils.checkNotNull(stream, "stream");
this.id = id;
this.key = key;
this.duration = duration;
this.file = file;
this.size = size;
this.container = container;
this.audioProfile = audioProfile;
this.has64bitOffsets = has64bitOffsets;
this.optimizedForStreaming = optimizedForStreaming;
this.videoProfile = videoProfile;
this.indexes = indexes;
this.hasThumbnail = hasThumbnail;
this.stream = stream;
}
public Part(
int id,
String key,
String file,
long size,
String container) {
this(id, key, Optional.empty(), file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public int id() {
return id;
}
@JsonIgnore
public String key() {
return key;
}
@JsonIgnore
public Optional<Integer> duration() {
return duration;
}
@JsonIgnore
public String file() {
return file;
}
@JsonIgnore
public long size() {
return size;
}
/**
* The container format of the media file.
*
*/
@JsonIgnore
public String container() {
return container;
}
@JsonIgnore
public Optional<String> audioProfile() {
return audioProfile;
}
@JsonIgnore
public Optional<Boolean> has64bitOffsets() {
return has64bitOffsets;
}
@JsonIgnore
public Optional<Boolean> optimizedForStreaming() {
return optimizedForStreaming;
}
@JsonIgnore
public Optional<String> videoProfile() {
return videoProfile;
}
@JsonIgnore
public Optional<String> indexes() {
return indexes;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<HasThumbnail> hasThumbnail() {
return (Optional<HasThumbnail>) hasThumbnail;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<List<Stream>> stream() {
return (Optional<List<Stream>>) stream;
}
public final static Builder builder() {
return new Builder();
}
public Part withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
public Part withKey(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
public Part withDuration(int duration) {
Utils.checkNotNull(duration, "duration");
this.duration = Optional.ofNullable(duration);
return this;
}
public Part withDuration(Optional<Integer> duration) {
Utils.checkNotNull(duration, "duration");
this.duration = duration;
return this;
}
public Part withFile(String file) {
Utils.checkNotNull(file, "file");
this.file = file;
return this;
}
public Part withSize(long size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* The container format of the media file.
*
*/
public Part withContainer(String container) {
Utils.checkNotNull(container, "container");
this.container = container;
return this;
}
public Part withAudioProfile(String audioProfile) {
Utils.checkNotNull(audioProfile, "audioProfile");
this.audioProfile = Optional.ofNullable(audioProfile);
return this;
}
public Part withAudioProfile(Optional<String> audioProfile) {
Utils.checkNotNull(audioProfile, "audioProfile");
this.audioProfile = audioProfile;
return this;
}
public Part withHas64bitOffsets(boolean has64bitOffsets) {
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
this.has64bitOffsets = Optional.ofNullable(has64bitOffsets);
return this;
}
public Part withHas64bitOffsets(Optional<Boolean> has64bitOffsets) {
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
this.has64bitOffsets = has64bitOffsets;
return this;
}
public Part withOptimizedForStreaming(boolean optimizedForStreaming) {
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming);
return this;
}
public Part withOptimizedForStreaming(Optional<Boolean> optimizedForStreaming) {
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
this.optimizedForStreaming = optimizedForStreaming;
return this;
}
public Part withVideoProfile(String videoProfile) {
Utils.checkNotNull(videoProfile, "videoProfile");
this.videoProfile = Optional.ofNullable(videoProfile);
return this;
}
public Part withVideoProfile(Optional<String> videoProfile) {
Utils.checkNotNull(videoProfile, "videoProfile");
this.videoProfile = videoProfile;
return this;
}
public Part withIndexes(String indexes) {
Utils.checkNotNull(indexes, "indexes");
this.indexes = Optional.ofNullable(indexes);
return this;
}
public Part withIndexes(Optional<String> indexes) {
Utils.checkNotNull(indexes, "indexes");
this.indexes = indexes;
return this;
}
public Part withHasThumbnail(HasThumbnail hasThumbnail) {
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
this.hasThumbnail = Optional.ofNullable(hasThumbnail);
return this;
}
public Part withHasThumbnail(Optional<? extends HasThumbnail> hasThumbnail) {
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
this.hasThumbnail = hasThumbnail;
return this;
}
public Part withStream(List<Stream> stream) {
Utils.checkNotNull(stream, "stream");
this.stream = Optional.ofNullable(stream);
return this;
}
public Part withStream(Optional<? extends List<Stream>> stream) {
Utils.checkNotNull(stream, "stream");
this.stream = stream;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Part other = (Part) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.key, other.key) &&
Objects.deepEquals(this.duration, other.duration) &&
Objects.deepEquals(this.file, other.file) &&
Objects.deepEquals(this.size, other.size) &&
Objects.deepEquals(this.container, other.container) &&
Objects.deepEquals(this.audioProfile, other.audioProfile) &&
Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) &&
Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) &&
Objects.deepEquals(this.videoProfile, other.videoProfile) &&
Objects.deepEquals(this.indexes, other.indexes) &&
Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) &&
Objects.deepEquals(this.stream, other.stream);
}
@Override
public int hashCode() {
return Objects.hash(
id,
key,
duration,
file,
size,
container,
audioProfile,
has64bitOffsets,
optimizedForStreaming,
videoProfile,
indexes,
hasThumbnail,
stream);
}
@Override
public String toString() {
return Utils.toString(Part.class,
"id", id,
"key", key,
"duration", duration,
"file", file,
"size", size,
"container", container,
"audioProfile", audioProfile,
"has64bitOffsets", has64bitOffsets,
"optimizedForStreaming", optimizedForStreaming,
"videoProfile", videoProfile,
"indexes", indexes,
"hasThumbnail", hasThumbnail,
"stream", stream);
}
public final static class Builder {
private Integer id;
private String key;
private Optional<Integer> duration = Optional.empty();
private String file;
private Long size;
private String container;
private Optional<String> audioProfile = Optional.empty();
private Optional<Boolean> has64bitOffsets = Optional.empty();
private Optional<Boolean> optimizedForStreaming = Optional.empty();
private Optional<String> videoProfile = Optional.empty();
private Optional<String> indexes = Optional.empty();
private Optional<? extends HasThumbnail> hasThumbnail;
private Optional<? extends List<Stream>> stream = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
public Builder key(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
public Builder duration(int duration) {
Utils.checkNotNull(duration, "duration");
this.duration = Optional.ofNullable(duration);
return this;
}
public Builder duration(Optional<Integer> duration) {
Utils.checkNotNull(duration, "duration");
this.duration = duration;
return this;
}
public Builder file(String file) {
Utils.checkNotNull(file, "file");
this.file = file;
return this;
}
public Builder size(long size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* The container format of the media file.
*
*/
public Builder container(String container) {
Utils.checkNotNull(container, "container");
this.container = container;
return this;
}
public Builder audioProfile(String audioProfile) {
Utils.checkNotNull(audioProfile, "audioProfile");
this.audioProfile = Optional.ofNullable(audioProfile);
return this;
}
public Builder audioProfile(Optional<String> audioProfile) {
Utils.checkNotNull(audioProfile, "audioProfile");
this.audioProfile = audioProfile;
return this;
}
public Builder has64bitOffsets(boolean has64bitOffsets) {
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
this.has64bitOffsets = Optional.ofNullable(has64bitOffsets);
return this;
}
public Builder has64bitOffsets(Optional<Boolean> has64bitOffsets) {
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
this.has64bitOffsets = has64bitOffsets;
return this;
}
public Builder optimizedForStreaming(boolean optimizedForStreaming) {
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming);
return this;
}
public Builder optimizedForStreaming(Optional<Boolean> optimizedForStreaming) {
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
this.optimizedForStreaming = optimizedForStreaming;
return this;
}
public Builder videoProfile(String videoProfile) {
Utils.checkNotNull(videoProfile, "videoProfile");
this.videoProfile = Optional.ofNullable(videoProfile);
return this;
}
public Builder videoProfile(Optional<String> videoProfile) {
Utils.checkNotNull(videoProfile, "videoProfile");
this.videoProfile = videoProfile;
return this;
}
public Builder indexes(String indexes) {
Utils.checkNotNull(indexes, "indexes");
this.indexes = Optional.ofNullable(indexes);
return this;
}
public Builder indexes(Optional<String> indexes) {
Utils.checkNotNull(indexes, "indexes");
this.indexes = indexes;
return this;
}
public Builder hasThumbnail(HasThumbnail hasThumbnail) {
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
this.hasThumbnail = Optional.ofNullable(hasThumbnail);
return this;
}
public Builder hasThumbnail(Optional<? extends HasThumbnail> hasThumbnail) {
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
this.hasThumbnail = hasThumbnail;
return this;
}
public Builder stream(List<Stream> stream) {
Utils.checkNotNull(stream, "stream");
this.stream = Optional.ofNullable(stream);
return this;
}
public Builder stream(Optional<? extends List<Stream>> stream) {
Utils.checkNotNull(stream, "stream");
this.stream = stream;
return this;
}
public Part build() {
if (hasThumbnail == null) {
hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value();
} return new Part(
id,
key,
duration,
file,
size,
container,
audioProfile,
has64bitOffsets,
optimizedForStreaming,
videoProfile,
indexes,
hasThumbnail,
stream);
}
private static final LazySingletonValue<Optional<? extends HasThumbnail>> _SINGLETON_VALUE_HasThumbnail =
new LazySingletonValue<>(
"hasThumbnail",
"\"0\"",
new TypeReference<Optional<? extends HasThumbnail>>() {});
}
}