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

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

本文整理了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

  1. public synchronized boolean format(Format format) {
  2. if (format == null) {
  3. upstreamFormatRequired = true;
  4. return false;
  5. }
  6. upstreamFormatRequired = false;
  7. if (Util.areEqual(format, upstreamFormat)) {
  8. // Suppress changes between equal formats so we can use referential equality in readData.
  9. return false;
  10. } else {
  11. upstreamFormat = format;
  12. return true;
  13. }
  14. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. CommentFrame other = (CommentFrame) obj;
  10. return Util.areEqual(description, other.description) && Util.areEqual(language, other.language)
  11. && Util.areEqual(text, other.text);
  12. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. ProgramInformation other = (ProgramInformation) obj;
  10. return Util.areEqual(this.title, other.title)
  11. && Util.areEqual(this.source, other.source)
  12. && Util.areEqual(this.copyright, other.copyright)
  13. && Util.areEqual(this.moreInformationURL, other.moreInformationURL)
  14. && Util.areEqual(this.lang, other.lang);
  15. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (!(obj instanceof SchemeData)) {
  4. return false;
  5. }
  6. if (obj == this) {
  7. return true;
  8. }
  9. SchemeData other = (SchemeData) obj;
  10. return Util.areEqual(licenseServerUrl, other.licenseServerUrl)
  11. && Util.areEqual(mimeType, other.mimeType)
  12. && Util.areEqual(uuid, other.uuid)
  13. && Arrays.equals(data, other.data);
  14. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. GeobFrame other = (GeobFrame) obj;
  10. return Util.areEqual(mimeType, other.mimeType) && Util.areEqual(filename, other.filename)
  11. && Util.areEqual(description, other.description) && Arrays.equals(data, other.data);
  12. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. Descriptor other = (Descriptor) obj;
  10. return Util.areEqual(schemeIdUri, other.schemeIdUri) && Util.areEqual(value, other.value)
  11. && Util.areEqual(id, other.id);
  12. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. InternalFrame other = (InternalFrame) obj;
  10. return Util.areEqual(description, other.description)
  11. && Util.areEqual(domain, other.domain)
  12. && Util.areEqual(text, other.text);
  13. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. TextInformationFrame other = (TextInformationFrame) obj;
  10. return id.equals(other.id) && Util.areEqual(description, other.description)
  11. && Util.areEqual(value, other.value);
  12. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. UrlLinkFrame other = (UrlLinkFrame) obj;
  10. return id.equals(other.id) && Util.areEqual(description, other.description)
  11. && Util.areEqual(url, other.url);
  12. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. EventMessage other = (EventMessage) obj;
  10. return presentationTimeUs == other.presentationTimeUs && durationMs == other.durationMs
  11. && id == other.id && Util.areEqual(schemeIdUri, other.schemeIdUri)
  12. && Util.areEqual(value, other.value) && Arrays.equals(messageData, other.messageData);
  13. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. ApicFrame other = (ApicFrame) obj;
  10. return pictureType == other.pictureType && Util.areEqual(mimeType, other.mimeType)
  11. && Util.areEqual(description, other.description)
  12. && Arrays.equals(pictureData, other.pictureData);
  13. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. PrivFrame other = (PrivFrame) obj;
  10. return Util.areEqual(owner, other.owner) && Arrays.equals(privateData, other.privateData);
  11. }

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

  1. @Override
  2. public boolean equals(@Nullable Object obj) {
  3. if (this == obj) {
  4. return true;
  5. }
  6. if (obj == null || getClass() != obj.getClass()) {
  7. return false;
  8. }
  9. DrmInitData other = (DrmInitData) obj;
  10. return Util.areEqual(schemeType, other.schemeType)
  11. && Arrays.equals(schemeDatas, other.schemeDatas);
  12. }

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

  1. /**
  2. * Returns a copy with the specified protection scheme type.
  3. *
  4. * @param schemeType A protection scheme type. May be null.
  5. * @return A copy with the specified protection scheme type.
  6. */
  7. public DrmInitData copyWithSchemeType(@Nullable String schemeType) {
  8. if (Util.areEqual(this.schemeType, schemeType)) {
  9. return this;
  10. }
  11. return new DrmInitData(schemeType, false, schemeDatas);
  12. }

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

  1. @Override
  2. public boolean equals(@Nullable Object o) {
  3. if (this == o) {
  4. return true;
  5. }
  6. if (!super.equals(o)) {
  7. return false;
  8. }
  9. ProgressiveDownloadAction that = (ProgressiveDownloadAction) o;
  10. return Util.areEqual(customCacheKey, that.customCacheKey);
  11. }

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

  1. /**
  2. * Sets the {@link MediaSessionCompat.Token}.
  3. *
  4. * @param token The {@link MediaSessionCompat.Token}.
  5. */
  6. public final void setMediaSessionToken(MediaSessionCompat.Token token) {
  7. if (!Util.areEqual(this.mediaSessionToken, token)) {
  8. mediaSessionToken = token;
  9. invalidate();
  10. }
  11. }

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

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

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

  1. @Override
  2. public Period getPeriod(int periodIndex, Period period, boolean setIds) {
  3. timeline.getPeriod(periodIndex, period, setIds);
  4. if (Util.areEqual(period.uid, replacedId)) {
  5. period.uid = DUMMY_ID;
  6. }
  7. return period;
  8. }

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

  1. @Override
  2. public boolean equals(@Nullable Object other) {
  3. if (!(other instanceof EventWindowAndPeriodId)) {
  4. return false;
  5. }
  6. EventWindowAndPeriodId event = (EventWindowAndPeriodId) other;
  7. return windowIndex == event.windowIndex && Util.areEqual(mediaPeriodId, event.mediaPeriodId);
  8. }

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

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

相关文章