@Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   FlightRecord other = (FlightRecord) obj;
   if (cancellationInfo == null) {
     if (other.cancellationInfo != null) return false;
   } else if (!cancellationInfo.equals(other.cancellationInfo)) return false;
   if (date == null) {
     if (other.date != null) return false;
   } else if (!date.equals(other.date)) return false;
   if (flightID == null) {
     if (other.flightID != null) return false;
   } else if (!flightID.equals(other.flightID)) return false;
   if (isCancelled != other.isCancelled) return false;
   if (isDiverted != other.isDiverted) return false;
   if (passengers == null) {
     if (other.passengers != null) return false;
   } else if (!passengers.equals(other.passengers)) return false;
   if (plane == null) {
     if (other.plane != null) return false;
   } else if (!plane.equals(other.plane)) return false;
   return true;
 }
Exemple #2
0
    void update(final Task item) {
      task = item;
      int position = getPosition(item);
      Optional<?> thisHeader = groupFunction.apply(task);
      if (position >= 0 && thisHeader.isPresent()) {
        if (position == 0 || !thisHeader.equals(groupFunction.apply(getItem(position - 1)))) {
          header.setVisibility(View.VISIBLE);
          headerUnderline.setVisibility(View.VISIBLE);
          header.setText(thisHeader.get().toString());
        } else {
          header.setVisibility(View.GONE);
          headerUnderline.setVisibility(View.GONE);
        }
      } else {
        header.setVisibility(View.GONE);
        headerUnderline.setVisibility(View.GONE);
      }

      configureText(item);
      configureTimeText(item);
      configureStatus();
      textTitle.setClickable(isEditMode());
      textTime.setClickable(isEditMode());
      if (isSelected()) {
        this.convertView.setBackgroundColor(Color.rgb(50, 50, 50));
      } else {
        this.convertView.setBackgroundColor(
            getContext().getResources().getColor(android.R.color.background_dark));
      }
      if (canShowLevel()) {
        doneStatus.setPadding(task.getMasterTasks().size() * 32 + 5, 0, 5, 0);
      }
    }
 @Override
 public boolean equals(Object o) {
   if (!(o instanceof ApiElement)) {
     return false;
   }
   ApiElement that = (ApiElement) o;
   return type == that.type && name.equals(that.name) && parent.equals(that.parent);
 }
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    IOSDevicePayload that = (IOSDevicePayload) o;
    if (alert != null ? !alert.equals(that.alert) : that.alert != null) {
      return false;
    }
    if (extra != null ? !extra.equals(that.extra) : that.extra != null) {
      return false;
    }
    if (sound != null ? !sound.equals(that.sound) : that.sound != null) {
      return false;
    }
    if (badge != null ? !badge.equals(that.badge) : that.badge != null) {
      return false;
    }
    if (contentAvailable != null
        ? !contentAvailable.equals(that.contentAvailable)
        : that.contentAvailable != null) {
      return false;
    }
    if (expiry != null ? !expiry.equals(that.expiry) : that.expiry != null) {
      return false;
    }
    if (priority != null ? !priority.equals(that.priority) : that.priority != null) {
      return false;
    }
    return true;
  }
 @SuppressWarnings("unchecked")
 @Override
 public boolean canBeAppliedOn(Optional<?> obj) {
   switch (type) {
     case ADDED:
       return obj == null;
     case REMOVED:
       return obj.equals(oldGeometry);
     case MODIFIED:
     default:
       return diff.canBeAppliedOn((Optional<Geometry>) obj);
   }
 }
Exemple #6
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof WhereClause)) return false;

    WhereClause that = (WhereClause) o;
    if (query != null ? !query.equals(that.query) : that.query != null) return false;
    if (noMatch != that.noMatch) return false;
    if (!docKeys.equals(that.docKeys)) return false;
    if (!clusteredBy.equals(that.clusteredBy)) return false;
    if (partitions != null ? !partitions.equals(that.partitions) : that.partitions != null)
      return false;
    return true;
  }
 public GeometryAttributeDiff(Optional<Geometry> oldGeom, Optional<Geometry> newGeom) {
   Preconditions.checkArgument(oldGeom != null || newGeom != null);
   oldGeometry = oldGeom;
   newGeometry = newGeom;
   if (newGeom == null || !newGeom.isPresent()) {
     type = TYPE.REMOVED;
   } else if (oldGeom == null || !oldGeom.isPresent()) {
     type = TYPE.ADDED;
   } else if (oldGeom.equals(newGeom)) {
     type = TYPE.NO_CHANGE;
     diff = new LCSGeometryDiffImpl(oldGeom, newGeom);
   } else {
     type = TYPE.MODIFIED;
     diff = new LCSGeometryDiffImpl(oldGeom, newGeom);
   }
 }
Exemple #8
0
    @Override
    public boolean equals(Object other) {
      if (this == other) {
        return true;
      }

      if (!(other instanceof DecompressorDescriptor)) {
        return false;
      }

      DecompressorDescriptor descriptor = (DecompressorDescriptor) other;
      return targetKind.equals(descriptor.targetKind)
          && targetName.equals(descriptor.targetName)
          && archivePath.equals(descriptor.archivePath)
          && repositoryPath.equals(descriptor.repositoryPath)
          && prefix.equals(descriptor.prefix);
    }
 void invalidateIfBuckConfigHasChanged(Cell cell, Path buildFile) {
   try (AutoCloseableLock writeLock = rawAndComputedNodesLock.writeLock()) {
     // TODO(mzlee): Check whether usedConfigs includes the buildFileName
     ImmutableMap<String, ImmutableMap<String, Optional<String>>> usedConfigs =
         buildFileConfigs.get(buildFile);
     if (usedConfigs == null) {
       // TODO(mzlee): Figure out when/how we can safely update this
       this.cell = cell;
       return;
     }
     for (Map.Entry<String, ImmutableMap<String, Optional<String>>> keyEnt :
         usedConfigs.entrySet()) {
       for (Map.Entry<String, Optional<String>> valueEnt : keyEnt.getValue().entrySet()) {
         Optional<String> value =
             cell.getBuckConfig().getValue(keyEnt.getKey(), valueEnt.getKey());
         if (!value.equals(valueEnt.getValue())) {
           invalidatePath(buildFile);
           this.cell = cell;
           return;
         }
       }
     }
   }
 }