/*
 * Jellyfin API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 10.11.6
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package org.openhab.binding.jellyfin.internal.gen.current.model;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.OffsetDateTime;
import java.util.Objects;
import java.util.StringJoiner;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * RemoteSubtitleInfo
 */
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator")
public class RemoteSubtitleInfo {
    public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME = "ThreeLetterISOLanguageName";
    private @org.eclipse.jdt.annotation.Nullable String threeLetterISOLanguageName;

    public static final String JSON_PROPERTY_ID = "Id";
    private @org.eclipse.jdt.annotation.Nullable String id;

    public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName";
    private @org.eclipse.jdt.annotation.Nullable String providerName;

    public static final String JSON_PROPERTY_NAME = "Name";
    private @org.eclipse.jdt.annotation.Nullable String name;

    public static final String JSON_PROPERTY_FORMAT = "Format";
    private @org.eclipse.jdt.annotation.Nullable String format;

    public static final String JSON_PROPERTY_AUTHOR = "Author";
    private @org.eclipse.jdt.annotation.Nullable String author;

    public static final String JSON_PROPERTY_COMMENT = "Comment";
    private @org.eclipse.jdt.annotation.Nullable String comment;

    public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated";
    private @org.eclipse.jdt.annotation.Nullable OffsetDateTime dateCreated;

    public static final String JSON_PROPERTY_COMMUNITY_RATING = "CommunityRating";
    private @org.eclipse.jdt.annotation.Nullable Float communityRating;

    public static final String JSON_PROPERTY_FRAME_RATE = "FrameRate";
    private @org.eclipse.jdt.annotation.Nullable Float frameRate;

    public static final String JSON_PROPERTY_DOWNLOAD_COUNT = "DownloadCount";
    private @org.eclipse.jdt.annotation.Nullable Integer downloadCount;

    public static final String JSON_PROPERTY_IS_HASH_MATCH = "IsHashMatch";
    private @org.eclipse.jdt.annotation.Nullable Boolean isHashMatch;

    public static final String JSON_PROPERTY_AI_TRANSLATED = "AiTranslated";
    private @org.eclipse.jdt.annotation.Nullable Boolean aiTranslated;

    public static final String JSON_PROPERTY_MACHINE_TRANSLATED = "MachineTranslated";
    private @org.eclipse.jdt.annotation.Nullable Boolean machineTranslated;

    public static final String JSON_PROPERTY_FORCED = "Forced";
    private @org.eclipse.jdt.annotation.Nullable Boolean forced;

    public static final String JSON_PROPERTY_HEARING_IMPAIRED = "HearingImpaired";
    private @org.eclipse.jdt.annotation.Nullable Boolean hearingImpaired;

    public RemoteSubtitleInfo() {
    }

    public RemoteSubtitleInfo threeLetterISOLanguageName(
            @org.eclipse.jdt.annotation.Nullable String threeLetterISOLanguageName) {
        this.threeLetterISOLanguageName = threeLetterISOLanguageName;
        return this;
    }

    /**
     * Get threeLetterISOLanguageName
     * 
     * @return threeLetterISOLanguageName
     */
    @JsonProperty(value = JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME)
    public @org.eclipse.jdt.annotation.Nullable String getThreeLetterISOLanguageName() {
        return threeLetterISOLanguageName;
    }

    @JsonProperty(value = JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME)
    public void setThreeLetterISOLanguageName(@org.eclipse.jdt.annotation.Nullable String threeLetterISOLanguageName) {
        this.threeLetterISOLanguageName = threeLetterISOLanguageName;
    }

    public RemoteSubtitleInfo id(@org.eclipse.jdt.annotation.Nullable String id) {
        this.id = id;
        return this;
    }

    /**
     * Get id
     * 
     * @return id
     */
    @JsonProperty(value = JSON_PROPERTY_ID)
    public @org.eclipse.jdt.annotation.Nullable String getId() {
        return id;
    }

    @JsonProperty(value = JSON_PROPERTY_ID)
    public void setId(@org.eclipse.jdt.annotation.Nullable String id) {
        this.id = id;
    }

    public RemoteSubtitleInfo providerName(@org.eclipse.jdt.annotation.Nullable String providerName) {
        this.providerName = providerName;
        return this;
    }

    /**
     * Get providerName
     * 
     * @return providerName
     */
    @JsonProperty(value = JSON_PROPERTY_PROVIDER_NAME)
    public @org.eclipse.jdt.annotation.Nullable String getProviderName() {
        return providerName;
    }

    @JsonProperty(value = JSON_PROPERTY_PROVIDER_NAME)
    public void setProviderName(@org.eclipse.jdt.annotation.Nullable String providerName) {
        this.providerName = providerName;
    }

    public RemoteSubtitleInfo name(@org.eclipse.jdt.annotation.Nullable String name) {
        this.name = name;
        return this;
    }

    /**
     * Get name
     * 
     * @return name
     */
    @JsonProperty(value = JSON_PROPERTY_NAME)
    public @org.eclipse.jdt.annotation.Nullable String getName() {
        return name;
    }

    @JsonProperty(value = JSON_PROPERTY_NAME)
    public void setName(@org.eclipse.jdt.annotation.Nullable String name) {
        this.name = name;
    }

    public RemoteSubtitleInfo format(@org.eclipse.jdt.annotation.Nullable String format) {
        this.format = format;
        return this;
    }

    /**
     * Get format
     * 
     * @return format
     */
    @JsonProperty(value = JSON_PROPERTY_FORMAT)
    public @org.eclipse.jdt.annotation.Nullable String getFormat() {
        return format;
    }

    @JsonProperty(value = JSON_PROPERTY_FORMAT)
    public void setFormat(@org.eclipse.jdt.annotation.Nullable String format) {
        this.format = format;
    }

    public RemoteSubtitleInfo author(@org.eclipse.jdt.annotation.Nullable String author) {
        this.author = author;
        return this;
    }

    /**
     * Get author
     * 
     * @return author
     */
    @JsonProperty(value = JSON_PROPERTY_AUTHOR)
    public @org.eclipse.jdt.annotation.Nullable String getAuthor() {
        return author;
    }

    @JsonProperty(value = JSON_PROPERTY_AUTHOR)
    public void setAuthor(@org.eclipse.jdt.annotation.Nullable String author) {
        this.author = author;
    }

    public RemoteSubtitleInfo comment(@org.eclipse.jdt.annotation.Nullable String comment) {
        this.comment = comment;
        return this;
    }

    /**
     * Get comment
     * 
     * @return comment
     */
    @JsonProperty(value = JSON_PROPERTY_COMMENT)
    public @org.eclipse.jdt.annotation.Nullable String getComment() {
        return comment;
    }

    @JsonProperty(value = JSON_PROPERTY_COMMENT)
    public void setComment(@org.eclipse.jdt.annotation.Nullable String comment) {
        this.comment = comment;
    }

    public RemoteSubtitleInfo dateCreated(@org.eclipse.jdt.annotation.Nullable OffsetDateTime dateCreated) {
        this.dateCreated = dateCreated;
        return this;
    }

    /**
     * Get dateCreated
     * 
     * @return dateCreated
     */
    @JsonProperty(value = JSON_PROPERTY_DATE_CREATED)
    public @org.eclipse.jdt.annotation.Nullable OffsetDateTime getDateCreated() {
        return dateCreated;
    }

    @JsonProperty(value = JSON_PROPERTY_DATE_CREATED)
    public void setDateCreated(@org.eclipse.jdt.annotation.Nullable OffsetDateTime dateCreated) {
        this.dateCreated = dateCreated;
    }

    public RemoteSubtitleInfo communityRating(@org.eclipse.jdt.annotation.Nullable Float communityRating) {
        this.communityRating = communityRating;
        return this;
    }

    /**
     * Get communityRating
     * 
     * @return communityRating
     */
    @JsonProperty(value = JSON_PROPERTY_COMMUNITY_RATING)
    public @org.eclipse.jdt.annotation.Nullable Float getCommunityRating() {
        return communityRating;
    }

    @JsonProperty(value = JSON_PROPERTY_COMMUNITY_RATING)
    public void setCommunityRating(@org.eclipse.jdt.annotation.Nullable Float communityRating) {
        this.communityRating = communityRating;
    }

    public RemoteSubtitleInfo frameRate(@org.eclipse.jdt.annotation.Nullable Float frameRate) {
        this.frameRate = frameRate;
        return this;
    }

    /**
     * Get frameRate
     * 
     * @return frameRate
     */
    @JsonProperty(value = JSON_PROPERTY_FRAME_RATE)
    public @org.eclipse.jdt.annotation.Nullable Float getFrameRate() {
        return frameRate;
    }

    @JsonProperty(value = JSON_PROPERTY_FRAME_RATE)
    public void setFrameRate(@org.eclipse.jdt.annotation.Nullable Float frameRate) {
        this.frameRate = frameRate;
    }

    public RemoteSubtitleInfo downloadCount(@org.eclipse.jdt.annotation.Nullable Integer downloadCount) {
        this.downloadCount = downloadCount;
        return this;
    }

    /**
     * Get downloadCount
     * 
     * @return downloadCount
     */
    @JsonProperty(value = JSON_PROPERTY_DOWNLOAD_COUNT)
    public @org.eclipse.jdt.annotation.Nullable Integer getDownloadCount() {
        return downloadCount;
    }

    @JsonProperty(value = JSON_PROPERTY_DOWNLOAD_COUNT)
    public void setDownloadCount(@org.eclipse.jdt.annotation.Nullable Integer downloadCount) {
        this.downloadCount = downloadCount;
    }

    public RemoteSubtitleInfo isHashMatch(@org.eclipse.jdt.annotation.Nullable Boolean isHashMatch) {
        this.isHashMatch = isHashMatch;
        return this;
    }

    /**
     * Get isHashMatch
     * 
     * @return isHashMatch
     */
    @JsonProperty(value = JSON_PROPERTY_IS_HASH_MATCH)
    public @org.eclipse.jdt.annotation.Nullable Boolean getIsHashMatch() {
        return isHashMatch;
    }

    @JsonProperty(value = JSON_PROPERTY_IS_HASH_MATCH)
    public void setIsHashMatch(@org.eclipse.jdt.annotation.Nullable Boolean isHashMatch) {
        this.isHashMatch = isHashMatch;
    }

    public RemoteSubtitleInfo aiTranslated(@org.eclipse.jdt.annotation.Nullable Boolean aiTranslated) {
        this.aiTranslated = aiTranslated;
        return this;
    }

    /**
     * Get aiTranslated
     * 
     * @return aiTranslated
     */
    @JsonProperty(value = JSON_PROPERTY_AI_TRANSLATED)
    public @org.eclipse.jdt.annotation.Nullable Boolean getAiTranslated() {
        return aiTranslated;
    }

    @JsonProperty(value = JSON_PROPERTY_AI_TRANSLATED)
    public void setAiTranslated(@org.eclipse.jdt.annotation.Nullable Boolean aiTranslated) {
        this.aiTranslated = aiTranslated;
    }

    public RemoteSubtitleInfo machineTranslated(@org.eclipse.jdt.annotation.Nullable Boolean machineTranslated) {
        this.machineTranslated = machineTranslated;
        return this;
    }

    /**
     * Get machineTranslated
     * 
     * @return machineTranslated
     */
    @JsonProperty(value = JSON_PROPERTY_MACHINE_TRANSLATED)
    public @org.eclipse.jdt.annotation.Nullable Boolean getMachineTranslated() {
        return machineTranslated;
    }

    @JsonProperty(value = JSON_PROPERTY_MACHINE_TRANSLATED)
    public void setMachineTranslated(@org.eclipse.jdt.annotation.Nullable Boolean machineTranslated) {
        this.machineTranslated = machineTranslated;
    }

    public RemoteSubtitleInfo forced(@org.eclipse.jdt.annotation.Nullable Boolean forced) {
        this.forced = forced;
        return this;
    }

    /**
     * Get forced
     * 
     * @return forced
     */
    @JsonProperty(value = JSON_PROPERTY_FORCED)
    public @org.eclipse.jdt.annotation.Nullable Boolean getForced() {
        return forced;
    }

    @JsonProperty(value = JSON_PROPERTY_FORCED)
    public void setForced(@org.eclipse.jdt.annotation.Nullable Boolean forced) {
        this.forced = forced;
    }

    public RemoteSubtitleInfo hearingImpaired(@org.eclipse.jdt.annotation.Nullable Boolean hearingImpaired) {
        this.hearingImpaired = hearingImpaired;
        return this;
    }

    /**
     * Get hearingImpaired
     * 
     * @return hearingImpaired
     */
    @JsonProperty(value = JSON_PROPERTY_HEARING_IMPAIRED)
    public @org.eclipse.jdt.annotation.Nullable Boolean getHearingImpaired() {
        return hearingImpaired;
    }

    @JsonProperty(value = JSON_PROPERTY_HEARING_IMPAIRED)
    public void setHearingImpaired(@org.eclipse.jdt.annotation.Nullable Boolean hearingImpaired) {
        this.hearingImpaired = hearingImpaired;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        RemoteSubtitleInfo remoteSubtitleInfo = (RemoteSubtitleInfo) o;
        return Objects.equals(this.threeLetterISOLanguageName, remoteSubtitleInfo.threeLetterISOLanguageName)
                && Objects.equals(this.id, remoteSubtitleInfo.id)
                && Objects.equals(this.providerName, remoteSubtitleInfo.providerName)
                && Objects.equals(this.name, remoteSubtitleInfo.name)
                && Objects.equals(this.format, remoteSubtitleInfo.format)
                && Objects.equals(this.author, remoteSubtitleInfo.author)
                && Objects.equals(this.comment, remoteSubtitleInfo.comment)
                && Objects.equals(this.dateCreated, remoteSubtitleInfo.dateCreated)
                && Objects.equals(this.communityRating, remoteSubtitleInfo.communityRating)
                && Objects.equals(this.frameRate, remoteSubtitleInfo.frameRate)
                && Objects.equals(this.downloadCount, remoteSubtitleInfo.downloadCount)
                && Objects.equals(this.isHashMatch, remoteSubtitleInfo.isHashMatch)
                && Objects.equals(this.aiTranslated, remoteSubtitleInfo.aiTranslated)
                && Objects.equals(this.machineTranslated, remoteSubtitleInfo.machineTranslated)
                && Objects.equals(this.forced, remoteSubtitleInfo.forced)
                && Objects.equals(this.hearingImpaired, remoteSubtitleInfo.hearingImpaired);
    }

    @Override
    public int hashCode() {
        return Objects.hash(threeLetterISOLanguageName, id, providerName, name, format, author, comment, dateCreated,
                communityRating, frameRate, downloadCount, isHashMatch, aiTranslated, machineTranslated, forced,
                hearingImpaired);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class RemoteSubtitleInfo {\n");
        sb.append("    threeLetterISOLanguageName: ").append(toIndentedString(threeLetterISOLanguageName)).append("\n");
        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    providerName: ").append(toIndentedString(providerName)).append("\n");
        sb.append("    name: ").append(toIndentedString(name)).append("\n");
        sb.append("    format: ").append(toIndentedString(format)).append("\n");
        sb.append("    author: ").append(toIndentedString(author)).append("\n");
        sb.append("    comment: ").append(toIndentedString(comment)).append("\n");
        sb.append("    dateCreated: ").append(toIndentedString(dateCreated)).append("\n");
        sb.append("    communityRating: ").append(toIndentedString(communityRating)).append("\n");
        sb.append("    frameRate: ").append(toIndentedString(frameRate)).append("\n");
        sb.append("    downloadCount: ").append(toIndentedString(downloadCount)).append("\n");
        sb.append("    isHashMatch: ").append(toIndentedString(isHashMatch)).append("\n");
        sb.append("    aiTranslated: ").append(toIndentedString(aiTranslated)).append("\n");
        sb.append("    machineTranslated: ").append(toIndentedString(machineTranslated)).append("\n");
        sb.append("    forced: ").append(toIndentedString(forced)).append("\n");
        sb.append("    hearingImpaired: ").append(toIndentedString(hearingImpaired)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(Object o) {
        return o == null ? "null" : o.toString().replace("\n", "\n    ");
    }

    /**
     * Convert the instance into URL query string.
     *
     * @return URL query string
     */
    public String toUrlQueryString() {
        return toUrlQueryString(null);
    }

    /**
     * Convert the instance into URL query string.
     *
     * @param prefix prefix of the query string
     * @return URL query string
     */
    public String toUrlQueryString(String prefix) {
        String suffix = "";
        String containerSuffix = "";
        String containerPrefix = "";
        if (prefix == null) {
            // style=form, explode=true, e.g. /pet?name=cat&type=manx
            prefix = "";
        } else {
            // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
            prefix = prefix + "[";
            suffix = "]";
            containerSuffix = "]";
            containerPrefix = "[";
        }

        StringJoiner joiner = new StringJoiner("&");

        // add `ThreeLetterISOLanguageName` to the URL query string
        if (getThreeLetterISOLanguageName() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sThreeLetterISOLanguageName%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getThreeLetterISOLanguageName()), "UTF-8").replaceAll("\\+",
                                "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `Id` to the URL query string
        if (getId() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sId%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `ProviderName` to the URL query string
        if (getProviderName() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sProviderName%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getProviderName()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `Name` to the URL query string
        if (getName() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sName%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `Format` to the URL query string
        if (getFormat() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sFormat%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getFormat()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `Author` to the URL query string
        if (getAuthor() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sAuthor%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getAuthor()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `Comment` to the URL query string
        if (getComment() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sComment%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getComment()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `DateCreated` to the URL query string
        if (getDateCreated() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sDateCreated%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getDateCreated()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `CommunityRating` to the URL query string
        if (getCommunityRating() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sCommunityRating%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getCommunityRating()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `FrameRate` to the URL query string
        if (getFrameRate() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sFrameRate%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getFrameRate()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `DownloadCount` to the URL query string
        if (getDownloadCount() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sDownloadCount%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getDownloadCount()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `IsHashMatch` to the URL query string
        if (getIsHashMatch() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sIsHashMatch%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getIsHashMatch()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `AiTranslated` to the URL query string
        if (getAiTranslated() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sAiTranslated%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getAiTranslated()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `MachineTranslated` to the URL query string
        if (getMachineTranslated() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sMachineTranslated%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getMachineTranslated()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `Forced` to the URL query string
        if (getForced() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sForced%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getForced()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        // add `HearingImpaired` to the URL query string
        if (getHearingImpaired() != null) {
            try {
                joiner.add(String.format(java.util.Locale.ROOT, "%sHearingImpaired%s=%s", prefix, suffix,
                        URLEncoder.encode(String.valueOf(getHearingImpaired()), "UTF-8").replaceAll("\\+", "%20")));
            } catch (UnsupportedEncodingException e) {
                // Should never happen, UTF-8 is always supported
                throw new RuntimeException(e);
            }
        }

        return joiner.toString();
    }

    public static class Builder {

        private RemoteSubtitleInfo instance;

        public Builder() {
            this(new RemoteSubtitleInfo());
        }

        protected Builder(RemoteSubtitleInfo instance) {
            this.instance = instance;
        }

        public RemoteSubtitleInfo.Builder threeLetterISOLanguageName(String threeLetterISOLanguageName) {
            this.instance.threeLetterISOLanguageName = threeLetterISOLanguageName;
            return this;
        }

        public RemoteSubtitleInfo.Builder id(String id) {
            this.instance.id = id;
            return this;
        }

        public RemoteSubtitleInfo.Builder providerName(String providerName) {
            this.instance.providerName = providerName;
            return this;
        }

        public RemoteSubtitleInfo.Builder name(String name) {
            this.instance.name = name;
            return this;
        }

        public RemoteSubtitleInfo.Builder format(String format) {
            this.instance.format = format;
            return this;
        }

        public RemoteSubtitleInfo.Builder author(String author) {
            this.instance.author = author;
            return this;
        }

        public RemoteSubtitleInfo.Builder comment(String comment) {
            this.instance.comment = comment;
            return this;
        }

        public RemoteSubtitleInfo.Builder dateCreated(OffsetDateTime dateCreated) {
            this.instance.dateCreated = dateCreated;
            return this;
        }

        public RemoteSubtitleInfo.Builder communityRating(Float communityRating) {
            this.instance.communityRating = communityRating;
            return this;
        }

        public RemoteSubtitleInfo.Builder frameRate(Float frameRate) {
            this.instance.frameRate = frameRate;
            return this;
        }

        public RemoteSubtitleInfo.Builder downloadCount(Integer downloadCount) {
            this.instance.downloadCount = downloadCount;
            return this;
        }

        public RemoteSubtitleInfo.Builder isHashMatch(Boolean isHashMatch) {
            this.instance.isHashMatch = isHashMatch;
            return this;
        }

        public RemoteSubtitleInfo.Builder aiTranslated(Boolean aiTranslated) {
            this.instance.aiTranslated = aiTranslated;
            return this;
        }

        public RemoteSubtitleInfo.Builder machineTranslated(Boolean machineTranslated) {
            this.instance.machineTranslated = machineTranslated;
            return this;
        }

        public RemoteSubtitleInfo.Builder forced(Boolean forced) {
            this.instance.forced = forced;
            return this;
        }

        public RemoteSubtitleInfo.Builder hearingImpaired(Boolean hearingImpaired) {
            this.instance.hearingImpaired = hearingImpaired;
            return this;
        }

        /**
         * returns a built RemoteSubtitleInfo instance.
         *
         * The builder is not reusable.
         */
        public RemoteSubtitleInfo build() {
            try {
                return this.instance;
            } finally {
                // ensure that this.instance is not reused
                this.instance = null;
            }
        }

        @Override
        public String toString() {
            return getClass() + "=(" + instance + ")";
        }
    }

    /**
     * Create a builder with no initialized field.
     */
    public static RemoteSubtitleInfo.Builder builder() {
        return new RemoteSubtitleInfo.Builder();
    }

    /**
     * Create a builder with a shallow copy of this instance.
     */
    public RemoteSubtitleInfo.Builder toBuilder() {
        return new RemoteSubtitleInfo.Builder().threeLetterISOLanguageName(getThreeLetterISOLanguageName()).id(getId())
                .providerName(getProviderName()).name(getName()).format(getFormat()).author(getAuthor())
                .comment(getComment()).dateCreated(getDateCreated()).communityRating(getCommunityRating())
                .frameRate(getFrameRate()).downloadCount(getDownloadCount()).isHashMatch(getIsHashMatch())
                .aiTranslated(getAiTranslated()).machineTranslated(getMachineTranslated()).forced(getForced())
                .hearingImpaired(getHearingImpaired());
    }
}
