com.google.android.exoplayer2.util.Util.areEqual()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(225)

本文整理了Java中com.google.android.exoplayer2.util.Util.areEqual()方法的一些代码示例,展示了Util.areEqual()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.areEqual()方法的具体详情如下:
包路径:com.google.android.exoplayer2.util.Util
类名称:Util
方法名:areEqual

Util.areEqual介绍

[英]Tests two objects for Object#equals(Object) equality, handling the case where one or both may be null.
[中]测试两个对象的Object#equals(Object)相等性,处理其中一个或两个都可能为null的情况。

代码示例

代码示例来源:origin: google/ExoPlayer

public synchronized boolean format(Format format) {
 if (format == null) {
  upstreamFormatRequired = true;
  return false;
 }
 upstreamFormatRequired = false;
 if (Util.areEqual(format, upstreamFormat)) {
  // Suppress changes between equal formats so we can use referential equality in readData.
  return false;
 } else {
  upstreamFormat = format;
  return true;
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 CommentFrame other = (CommentFrame) obj;
 return Util.areEqual(description, other.description) && Util.areEqual(language, other.language)
   && Util.areEqual(text, other.text);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 ProgramInformation other = (ProgramInformation) obj;
 return Util.areEqual(this.title, other.title)
   && Util.areEqual(this.source, other.source)
   && Util.areEqual(this.copyright, other.copyright)
   && Util.areEqual(this.moreInformationURL, other.moreInformationURL)
   && Util.areEqual(this.lang, other.lang);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (!(obj instanceof SchemeData)) {
  return false;
 }
 if (obj == this) {
  return true;
 }
 SchemeData other = (SchemeData) obj;
 return Util.areEqual(licenseServerUrl, other.licenseServerUrl)
   && Util.areEqual(mimeType, other.mimeType)
   && Util.areEqual(uuid, other.uuid)
   && Arrays.equals(data, other.data);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 GeobFrame other = (GeobFrame) obj;
 return Util.areEqual(mimeType, other.mimeType) && Util.areEqual(filename, other.filename)
   && Util.areEqual(description, other.description) && Arrays.equals(data, other.data);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 Descriptor other = (Descriptor) obj;
 return Util.areEqual(schemeIdUri, other.schemeIdUri) && Util.areEqual(value, other.value)
   && Util.areEqual(id, other.id);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 InternalFrame other = (InternalFrame) obj;
 return Util.areEqual(description, other.description)
   && Util.areEqual(domain, other.domain)
   && Util.areEqual(text, other.text);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 TextInformationFrame other = (TextInformationFrame) obj;
 return id.equals(other.id) && Util.areEqual(description, other.description)
   && Util.areEqual(value, other.value);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 UrlLinkFrame other = (UrlLinkFrame) obj;
 return id.equals(other.id) && Util.areEqual(description, other.description)
   && Util.areEqual(url, other.url);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 EventMessage other = (EventMessage) obj;
 return presentationTimeUs == other.presentationTimeUs && durationMs == other.durationMs
   && id == other.id && Util.areEqual(schemeIdUri, other.schemeIdUri)
   && Util.areEqual(value, other.value) && Arrays.equals(messageData, other.messageData);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 ApicFrame other = (ApicFrame) obj;
 return pictureType == other.pictureType && Util.areEqual(mimeType, other.mimeType)
   && Util.areEqual(description, other.description)
   && Arrays.equals(pictureData, other.pictureData);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 PrivFrame other = (PrivFrame) obj;
 return Util.areEqual(owner, other.owner) && Arrays.equals(privateData, other.privateData);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object obj) {
 if (this == obj) {
  return true;
 }
 if (obj == null || getClass() != obj.getClass()) {
  return false;
 }
 DrmInitData other = (DrmInitData) obj;
 return Util.areEqual(schemeType, other.schemeType)
   && Arrays.equals(schemeDatas, other.schemeDatas);
}

代码示例来源:origin: google/ExoPlayer

/**
 * Returns a copy with the specified protection scheme type.
 *
 * @param schemeType A protection scheme type. May be null.
 * @return A copy with the specified protection scheme type.
 */
public DrmInitData copyWithSchemeType(@Nullable String schemeType) {
 if (Util.areEqual(this.schemeType, schemeType)) {
  return this;
 }
 return new DrmInitData(schemeType, false, schemeDatas);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object o) {
 if (this == o) {
  return true;
 }
 if (!super.equals(o)) {
  return false;
 }
 ProgressiveDownloadAction that = (ProgressiveDownloadAction) o;
 return Util.areEqual(customCacheKey, that.customCacheKey);
}

代码示例来源:origin: google/ExoPlayer

/**
 * Sets the {@link MediaSessionCompat.Token}.
 *
 * @param token The {@link MediaSessionCompat.Token}.
 */
public final void setMediaSessionToken(MediaSessionCompat.Token token) {
 if (!Util.areEqual(this.mediaSessionToken, token)) {
  mediaSessionToken = token;
  invalidate();
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
 public Object getUidOfPeriod(int periodIndex) {
  Object uid = timeline.getUidOfPeriod(periodIndex);
  return Util.areEqual(uid, replacedId) ? DUMMY_ID : uid;
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
public Period getPeriod(int periodIndex, Period period, boolean setIds) {
 timeline.getPeriod(periodIndex, period, setIds);
 if (Util.areEqual(period.uid, replacedId)) {
  period.uid = DUMMY_ID;
 }
 return period;
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(@Nullable Object other) {
 if (!(other instanceof EventWindowAndPeriodId)) {
  return false;
 }
 EventWindowAndPeriodId event = (EventWindowAndPeriodId) other;
 return windowIndex == event.windowIndex && Util.areEqual(mediaPeriodId, event.mediaPeriodId);
}

代码示例来源:origin: google/ExoPlayer

@Override
public boolean equals(MediaDescriptionCompat d1, MediaDescriptionCompat d2) {
 return Util.areEqual(d1.getMediaId(), d2.getMediaId());
}

相关文章