@@ -613,12 +613,11 @@ public int hashCode() {
613613 clientDefinedAttributes );
614614 }
615615
616-
617616 /**
618617 * Builder for {@link Interstitial}.
619618 *
620- * <p>See RFC 8216bis, section 4.4.5.1 for how to consolidate multiple interstitials with
621- * the same {@linkplain HlsMediaPlaylist.Interstitial#id ID}.
619+ * <p>See RFC 8216bis, section 4.4.5.1 for how to consolidate multiple interstitials with the
620+ * same {@linkplain HlsMediaPlaylist.Interstitial#id ID}.
622621 */
623622 public static final class Builder {
624623
@@ -662,7 +661,8 @@ public Builder setAssetUri(@Nullable Uri assetUri) {
662661 return this ;
663662 }
664663 if (this .assetUri != null ) {
665- checkArgument (this .assetUri .equals (assetUri ),
664+ checkArgument (
665+ this .assetUri .equals (assetUri ),
666666 "Can't change assetUri from " + this .assetUri + " to " + assetUri );
667667 }
668668 this .assetUri = assetUri ;
@@ -675,7 +675,8 @@ public Builder setAssetListUri(@Nullable Uri assetListUri) {
675675 return this ;
676676 }
677677 if (this .assetListUri != null ) {
678- checkArgument (this .assetListUri .equals (assetListUri ),
678+ checkArgument (
679+ this .assetListUri .equals (assetListUri ),
679680 "Can't change assetListUri from " + this .assetListUri + " to " + assetListUri );
680681 }
681682 this .assetListUri = assetListUri ;
@@ -688,8 +689,12 @@ public Builder setStartDateUnixUs(long startDateUnixUs) {
688689 return this ;
689690 }
690691 if (this .startDateUnixUs != C .TIME_UNSET ) {
691- checkArgument (this .startDateUnixUs == startDateUnixUs ,
692- "Can't change startDateUnixUs from " + this .startDateUnixUs + " to " + startDateUnixUs );
692+ checkArgument (
693+ this .startDateUnixUs == startDateUnixUs ,
694+ "Can't change startDateUnixUs from "
695+ + this .startDateUnixUs
696+ + " to "
697+ + startDateUnixUs );
693698 }
694699 this .startDateUnixUs = startDateUnixUs ;
695700 return this ;
@@ -701,7 +706,8 @@ public Builder setEndDateUnixUs(long endDateUnixUs) {
701706 return this ;
702707 }
703708 if (this .endDateUnixUs != C .TIME_UNSET ) {
704- checkArgument (this .endDateUnixUs == endDateUnixUs ,
709+ checkArgument (
710+ this .endDateUnixUs == endDateUnixUs ,
705711 "Can't change endDateUnixUs from " + this .endDateUnixUs + " to " + endDateUnixUs );
706712 }
707713 this .endDateUnixUs = endDateUnixUs ;
@@ -714,7 +720,8 @@ public Builder setDurationUs(long durationUs) {
714720 return this ;
715721 }
716722 if (this .durationUs != C .TIME_UNSET ) {
717- checkArgument (this .durationUs == durationUs ,
723+ checkArgument (
724+ this .durationUs == durationUs ,
718725 "Can't change durationUs from " + this .durationUs + " to " + durationUs );
719726 }
720727 this .durationUs = durationUs ;
@@ -727,8 +734,12 @@ public Builder setPlannedDurationUs(long plannedDurationUs) {
727734 return this ;
728735 }
729736 if (this .plannedDurationUs != C .TIME_UNSET ) {
730- checkArgument (this .plannedDurationUs == plannedDurationUs ,
731- "Can't change plannedDurationUs from " + this .plannedDurationUs + " to " + plannedDurationUs );
737+ checkArgument (
738+ this .plannedDurationUs == plannedDurationUs ,
739+ "Can't change plannedDurationUs from "
740+ + this .plannedDurationUs
741+ + " to "
742+ + plannedDurationUs );
732743 }
733744 this .plannedDurationUs = plannedDurationUs ;
734745 return this ;
@@ -740,8 +751,12 @@ public Builder setCue(List<@Interstitial.CueTriggerType String> cue) {
740751 return this ;
741752 }
742753 if (!this .cue .isEmpty ()) {
743- checkArgument (this .cue .equals (cue ),
744- "Can't change cue from " + String .join (", " , this .cue ) + " to " + String .join (", " , cue ));
754+ checkArgument (
755+ this .cue .equals (cue ),
756+ "Can't change cue from "
757+ + String .join (", " , this .cue )
758+ + " to "
759+ + String .join (", " , cue ));
745760 }
746761 this .cue = cue ;
747762 return this ;
@@ -762,7 +777,8 @@ public Builder setResumeOffsetUs(long resumeOffsetUs) {
762777 return this ;
763778 }
764779 if (this .resumeOffsetUs != C .TIME_UNSET ) {
765- checkArgument (this .resumeOffsetUs == resumeOffsetUs ,
780+ checkArgument (
781+ this .resumeOffsetUs == resumeOffsetUs ,
766782 "Can't change resumeOffsetUs from " + this .resumeOffsetUs + " to " + resumeOffsetUs );
767783 }
768784 this .resumeOffsetUs = resumeOffsetUs ;
@@ -775,7 +791,8 @@ public Builder setPlayoutLimitUs(long playoutLimitUs) {
775791 return this ;
776792 }
777793 if (this .playoutLimitUs != C .TIME_UNSET ) {
778- checkArgument (this .playoutLimitUs == playoutLimitUs ,
794+ checkArgument (
795+ this .playoutLimitUs == playoutLimitUs ,
779796 "Can't change playoutLimitUs from " + this .playoutLimitUs + " to " + playoutLimitUs );
780797 }
781798 this .playoutLimitUs = playoutLimitUs ;
@@ -788,21 +805,30 @@ public Builder setSnapTypes(List<@Interstitial.SnapType String> snapTypes) {
788805 return this ;
789806 }
790807 if (!this .snapTypes .isEmpty ()) {
791- checkArgument (this .snapTypes .equals (snapTypes ),
792- "Can't change snapTypes from " + String .join (", " , this .snapTypes ) + " to " + String .join (", " , snapTypes ));
808+ checkArgument (
809+ this .snapTypes .equals (snapTypes ),
810+ "Can't change snapTypes from "
811+ + String .join (", " , this .snapTypes )
812+ + " to "
813+ + String .join (", " , snapTypes ));
793814 }
794815 this .snapTypes = snapTypes ;
795816 return this ;
796817 }
797818
798819 /** Sets the {@code NavigationRestriction}. */
799- public Builder setRestrictions (List <@ Interstitial .NavigationRestriction String > restrictions ) {
820+ public Builder setRestrictions (
821+ List <@ Interstitial .NavigationRestriction String > restrictions ) {
800822 if (restrictions .isEmpty ()) {
801823 return this ;
802824 }
803825 if (!this .restrictions .isEmpty ()) {
804- checkArgument (this .restrictions .equals (restrictions ),
805- "Can't change restrictions from " + String .join (", " , this .restrictions ) + " to " + String .join (", " , restrictions ));
826+ checkArgument (
827+ this .restrictions .equals (restrictions ),
828+ "Can't change restrictions from "
829+ + String .join (", " , this .restrictions )
830+ + " to "
831+ + String .join (", " , restrictions ));
806832 }
807833 this .restrictions = restrictions ;
808834 return this ;
@@ -814,17 +840,26 @@ public Builder setClientDefinedAttributes(
814840 if (clientDefinedAttributes .isEmpty ()) {
815841 return this ;
816842 }
817- for (Map .Entry <String , HlsMediaPlaylist .ClientDefinedAttribute > newEntry : clientDefinedAttributes .entrySet ()) {
843+ for (Map .Entry <String , HlsMediaPlaylist .ClientDefinedAttribute > newEntry :
844+ clientDefinedAttributes .entrySet ()) {
818845 String newKey = newEntry .getKey ();
819846 HlsMediaPlaylist .ClientDefinedAttribute newValue = newEntry .getValue ();
820847 if (this .clientDefinedAttributes .containsKey (newKey )) {
821- HlsMediaPlaylist .ClientDefinedAttribute existingValue = this .clientDefinedAttributes .get (newKey );
848+ HlsMediaPlaylist .ClientDefinedAttribute existingValue =
849+ this .clientDefinedAttributes .get (newKey );
822850 if (existingValue != null ) {
823851 checkArgument (
824852 existingValue .equals (newValue ),
825- "Can't change " + newKey + " from "
826- + existingValue .textValue + " " + existingValue .doubleValue + " to "
827- + newValue .textValue + " " + newValue .doubleValue );
853+ "Can't change "
854+ + newKey
855+ + " from "
856+ + existingValue .textValue
857+ + " "
858+ + existingValue .doubleValue
859+ + " to "
860+ + newValue .textValue
861+ + " "
862+ + newValue .doubleValue );
828863 }
829864 }
830865 this .clientDefinedAttributes .put (newKey , newValue );
@@ -834,8 +869,7 @@ public Builder setClientDefinedAttributes(
834869
835870 public @ Nullable Interstitial build () {
836871 if ((assetListUri == null && assetUri != null )
837- || (assetListUri != null && assetUri == null )
838- && startDateUnixUs != C .TIME_UNSET ) {
872+ || (assetListUri != null && assetUri == null ) && startDateUnixUs != C .TIME_UNSET ) {
839873 return new Interstitial (
840874 this .id ,
841875 this .assetUri ,
@@ -850,8 +884,7 @@ public Builder setClientDefinedAttributes(
850884 this .playoutLimitUs ,
851885 this .snapTypes ,
852886 this .restrictions ,
853- new ArrayList <>(this .clientDefinedAttributes .values ())
854- );
887+ new ArrayList <>(this .clientDefinedAttributes .values ()));
855888 }
856889 return null ;
857890 }
0 commit comments