public void testEquals_immutableList() {
   Collection<String> c = ImmutableList.of("a", "b", "c");
   assertTrue(c.equals(ImmutableList.of("a", "b", "c")));
   assertFalse(c.equals(ImmutableList.of("a", "c", "b")));
   assertFalse(c.equals(ImmutableList.of("a", "b")));
   assertFalse(c.equals(ImmutableList.of("a", "b", "c", "d")));
 }
  private void updateValueTypeFacet(
      RDFSNamedClass cls, Slot slot, OWLQuantifierRestriction restriction) {
    ValueType oldValueType = ((Cls) cls).getTemplateSlotValueType(slot);
    ValueType newValueType = oldValueType;
    Collection oldAllowedClses = ((Cls) cls).getTemplateSlotAllowedClses(slot);
    Collection newAllowedClses = oldAllowedClses;
    Collection oldAllowedValues = ((Cls) cls).getTemplateSlotAllowedValues(slot);
    Collection newAllowedValues = oldAllowedValues;
    RDFResource filler = restriction.getFiller();
    if (filler instanceof RDFSClass) {
      RDFSClass quantifierClass = (RDFSClass) filler;
      if (RDFSNames.Cls.LITERAL.equals(quantifierClass.getName())) {
        newValueType = ValueType.ANY;
      } else {
        newValueType = ValueType.INSTANCE;
        newAllowedClses = getQuantifierClsClses(quantifierClass);
      }
    } else {
      if (filler instanceof OWLDataRange) {
        newAllowedValues = ((OWLDataRange) filler).getOneOf().getValues();
        newValueType = ValueType.SYMBOL;
      } else {
        RDFSDatatype datatype = (RDFSDatatype) filler;
        if (datatype.equals(owlModel.getRDFXMLLiteralType())) {
          newValueType = ValueType.STRING;
        } else {
          String uri = XMLSchemaDatatypes.getXSDDatatype(datatype).getURI();
          newValueType = XMLSchemaDatatypes.getValueType(uri);
        }
      }
    }

    if (oldValueType == newValueType) {
      if (newValueType == ValueType.INSTANCE && !oldAllowedClses.equals(newAllowedClses)) {
        setAllowedClses(cls, slot, newAllowedClses);
      } else if (newValueType == ValueType.SYMBOL && !oldAllowedValues.equals(newAllowedValues)) {
        setAllowedValues(cls, slot, newAllowedValues);
      }
    } else {
      if (log.isLoggable(Level.FINE)) {
        log.fine(
            "+ Setting :VALUE-TYPE of "
                + cls.getName()
                + "."
                + slot.getName()
                + " to "
                + newValueType);
      }
      ((Cls) cls).setTemplateSlotValueType(slot, newValueType);
      if (newValueType == ValueType.INSTANCE) {
        setAllowedClses(cls, slot, newAllowedClses);
      } else if (newValueType == ValueType.SYMBOL) {
        setAllowedValues(cls, slot, newAllowedValues);
      }
    }
  }
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    BahmniObservation that = (BahmniObservation) o;

    if (conceptSortWeight != that.conceptSortWeight) return false;
    if (duration != null ? !duration.equals(that.duration) : that.duration != null) return false;
    if (encounterDateTime != null
        ? !encounterDateTime.equals(that.encounterDateTime)
        : that.encounterDateTime != null) return false;
    if (encounterTransactionObservation != null
        ? !encounterTransactionObservation.equals(that.encounterTransactionObservation)
        : that.encounterTransactionObservation != null) return false;
    if (groupMembers != null ? !groupMembers.equals(that.groupMembers) : that.groupMembers != null)
      return false;
    if (isAbnormal != null ? !isAbnormal.equals(that.isAbnormal) : that.isAbnormal != null)
      return false;
    if (providers != null ? !providers.equals(that.providers) : that.providers != null)
      return false;
    if (targetObsRelation != null
        ? !targetObsRelation.equals(that.targetObsRelation)
        : that.targetObsRelation != null) return false;
    if (type != null ? !type.equals(that.type) : that.type != null) return false;
    if (visitStartDateTime != null
        ? !visitStartDateTime.equals(that.visitStartDateTime)
        : that.visitStartDateTime != null) return false;

    return true;
  }
Example #4
0
 @Override
 public Collection<DynamicRecord> remove(long labelId, NodeStore nodeStore) {
   nodeStore.ensureHeavy(node, parseLabelsBody(labelField));
   Collection<DynamicRecord> existingRecords = node.getDynamicLabelRecords();
   long[] existingLabelIds = nodeStore.getDynamicLabelsArray(existingRecords);
   long[] newLabelIds = filter(existingLabelIds, labelId);
   if (new InlineNodeLabels(labelField, node)
       .tryInlineInNodeRecord(newLabelIds, existingRecords)) {
     setNotInUse(existingRecords);
   } else {
     Collection<DynamicRecord> newRecords =
         nodeStore.allocateRecordsForDynamicLabels(
             node.getId(), newLabelIds, existingRecords.iterator());
     node.setLabelField(dynamicPointer(newRecords), existingRecords);
     if (!newRecords.equals(
         existingRecords)) { // One less dynamic record, mark that one as not in use
       for (DynamicRecord record : existingRecords) {
         if (!newRecords.contains(record)) {
           record.setInUse(false);
           record.setLength(0); // so that it will not be made heavy again...
         }
       }
     }
   }
   return existingRecords;
 }
Example #5
0
 private void checkAssignment(AbstractElement object, String feature) {
   if (assignedFeatures.containsKey(feature)) {
     Collection<AbstractElement> sources = Lists.newArrayList(assignedFeatures.get(feature));
     assignedFeatures.replaceValues(feature, Collections.<AbstractElement>emptyList());
     if (sources != null && sources.equals(Collections.singletonList(object))) {
       if (getNestingLevel() == 0)
         acceptWarning(
             "The assigned value of feature '"
                 + feature
                 + "' will possibly override itself because it is used inside of a loop.",
             object,
             null);
     } else {
       if (sources != null) {
         if (getNestingLevel() == 0)
           for (AbstractElement source : sources)
             acceptWarning(
                 "The possibly assigned value of feature '"
                     + feature
                     + "' may be overridden by subsequent assignments.",
                 source,
                 null);
       }
       if (getNestingLevel() == 0)
         acceptWarning(
             "This assignment will override the possibly assigned value of feature '"
                 + feature
                 + "'.",
             object,
             null);
     }
   } else {
     assignedFeatures.put(feature, object);
   }
 }
    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
      if (this == obj) return true;
      if (obj == null) return false;
      if (!(obj instanceof LearnerEvaluationConfiguration)) return false;
      final LearnerEvaluationConfiguration other = (LearnerEvaluationConfiguration) obj;
      assert config != null && other.config != null;
      if (!config.equals(other.config)) return false;

      assert graph != null && other.graph != null;
      if (graph == null) {
        if (other.graph != null) return false;
      } else if (!graph.equals(other.graph)) return false;
      if (ifthenSequences == null) {
        if (other.ifthenSequences != null) return false;
      } else if (!ifthenSequences.equals(other.ifthenSequences)) return false;

      if (testSet == null) {
        if (other.testSet != null) return false;
      } else if (!testSet.equals(other.testSet)) return false;

      if (labelDetails == null) {
        if (other.labelDetails != null) return false;
      } else if (!labelDetails.equals(other.labelDetails)) return false;
      return true;
    }
Example #7
0
  public static void testSetAndGetWith5Seqnos() {
    SeqnoRange range = new SeqnoRange(10, 15);
    System.out.println("range=" + print(range));

    assert range.size() == 6;
    assert range.getNumberOfMissingMessages() == 6;
    assert range.getNumberOfReceivedMessages() == 0;

    range.set(10);
    assert range.getNumberOfMissingMessages() == 5;
    assert range.getNumberOfReceivedMessages() == 1;

    assert range.get(10);

    range.set(13);
    assert range.size() == 6;
    assert range.getNumberOfMissingMessages() == 4;
    assert range.getNumberOfReceivedMessages() == 2;

    range.set(13);
    assert range.size() == 6;
    assert range.getNumberOfMissingMessages() == 4;
    assert range.getNumberOfReceivedMessages() == 2;

    System.out.println("range=" + print(range));

    Collection<Range> xmits = range.getMessagesToRetransmit();
    Collection<Range> cleared_bits = range.getBits(false);

    System.out.println("xmits = " + xmits);
    System.out.println("cleared_bits = " + cleared_bits);

    assert xmits.equals(cleared_bits);
  }
 @Override
 public boolean equals(final Object other) {
   if (other == null) return false;
   if (other.getClass().equals(this.getClass())) {
     return typesRegExps.equals(((RegExpStageActivityTypes) other).typesRegExps);
   }
   return false;
 }
 @Override
 public boolean equals(@Nullable Object object) {
   if (object == this) {
     return true;
   }
   refreshIfEmpty();
   return delegate.equals(object);
 }
Example #10
0
 @Override
 public boolean equals(@Nullable Object obj) {
   if (obj instanceof InPredicate) {
     InPredicate<?> that = (InPredicate<?>) obj;
     return target.equals(that.target);
   }
   return false;
 }
 public boolean equals(Object o) {
   if (o instanceof CollectionProperty) {
     if (value != null) {
       return value.equals(((JMeterProperty) o).getObjectValue());
     }
   }
   return false;
 }
 /** {@inheritDoc} */
 @Override
 public boolean equals(Object o) {
   if (o instanceof MultipleInBagConstraint) {
     MultipleInBagConstraint mibc = (MultipleInBagConstraint) o;
     return bag.equals(mibc.bag) && evaluables.equals(mibc.evaluables);
   }
   return false;
 }
 /** @return The cached element type for this Collection or null if it is unknown. */
 public Class<?> getCachedElementType(Collection c) {
   for (Entry<Collection, Class<?>> entry : collectionElementTypeCache.entrySet()) {
     Collection k = entry.getKey();
     if (k == c || k.equals(c)) {
       return entry.getValue();
     }
   }
   return null;
 }
 private boolean collectionEqual(Collection<?> c1, Collection<?> c2) {
   Collection<?> bag1;
   Collection<?> bag2;
   if (mergeDuplicates) {
     bag1 = new HashSet<Object>(c1);
     bag2 = new HashSet<Object>(c2);
   } else {
     bag1 = new HashBag(c1);
     bag2 = new HashBag(c2);
   }
   return bag1.equals(bag2);
 }
Example #15
0
 @Override
 public boolean equals(Object obj) {
   try {
     readLock.lock();
     if (obj == null) {
       return false;
     }
     if (this == obj) {
       return true;
     }
     if (obj instanceof ConditionalCopySet) {
       return delegate.equals(((ConditionalCopySet<?>) obj).delegate);
     }
     if (obj instanceof Set) {
       return delegate.equals(obj);
     }
     return false;
   } finally {
     readLock.unlock();
   }
 }
Example #16
0
  // equals() and hashCode()
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    IssueType that = (IssueType) o;

    if (IssueTypeId != that.IssueTypeId) return false;
    if (Issue != null ? !Issue.equals(that.Issue) : that.Issue != null) return false;
    if (!IssueType.equals(that.IssueType)) return false;

    return true;
  }
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   MinedInformation other = (MinedInformation) obj;
   if (articleID_ != other.articleID_) return false;
   if (assertions_ == null) {
     if (other.assertions_ != null) return false;
   } else if (!assertions_.equals(other.assertions_)) return false;
   if (concreteAssertions_ == null) {
     if (other.concreteAssertions_ != null) return false;
   } else if (!concreteAssertions_.equals(other.concreteAssertions_)) return false;
   if (infoboxType_ == null) {
     if (other.infoboxType_ != null) return false;
   } else if (!infoboxType_.equals(other.infoboxType_)) return false;
   if (minedTypes_ != other.minedTypes_) return false;
   if (standing_ == null) {
     if (other.standing_ != null) return false;
   } else if (!standing_.equals(other.standing_)) return false;
   return true;
 }
Example #18
0
  @Override
  public boolean equals(Object object) {
    if (this == object) {
      return true;
    }

    if (!(object instanceof DataStructureBuiltin)) {
      return false;
    }

    DataStructureBuiltin dataStructureBuiltin = (DataStructureBuiltin) object;
    return sort.equals(dataStructureBuiltin.sort)
        && baseTerms.equals(dataStructureBuiltin.baseTerms);
  }
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    HighlightData that = (HighlightData) o;

    if (block != that.block) return false;
    if (!key.equals(that.key)) return false;
    if (level != that.level) return false;
    if (values != null ? !values.equals(that.values) : that.values != null) return false;

    return true;
  }
Example #20
0
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof ApplyDeltaCommand)) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }

    ApplyDeltaCommand that = (ApplyDeltaCommand) o;
    return keys.equals(that.keys);
  }
Example #21
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   OSPFServiceWrapper other = (OSPFServiceWrapper) obj;
   if (enabledState != other.enabledState) return false;
   if (ospfAreas == null) {
     if (other.ospfAreas != null) return false;
   } else if (!ospfAreas.equals(other.ospfAreas)) return false;
   if (routerId == null) {
     if (other.routerId != null) return false;
   } else if (!routerId.equals(other.routerId)) return false;
   return true;
 }
Example #22
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   OrderDTO other = (OrderDTO) obj;
   if (created == null) {
     if (other.created != null) return false;
   } else if (!created.equals(other.created)) return false;
   if (customerId != other.customerId) return false;
   if (id != other.id) return false;
   if (positions == null) {
     if (other.positions != null) return false;
   } else if (!positions.equals(other.positions)) return false;
   return true;
 }
Example #23
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof CategorieStoc)) return false;

    CategorieStoc that = (CategorieStoc) o;

    if (idCategorieStoc != that.idCategorieStoc) return false;
    if (codCategorie != null ? !codCategorie.equals(that.codCategorie) : that.codCategorie != null)
      return false;
    if (numeCategorie != null
        ? !numeCategorie.equals(that.numeCategorie)
        : that.numeCategorie != null) return false;
    if (parent != null ? !parent.equals(that.parent) : that.parent != null) return false;
    return !(children != null ? !children.equals(that.children) : that.children != null);
  }
Example #24
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   NormalForm other = (NormalForm) obj;
   if (arguments_in_use == null) {
     if (other.arguments_in_use != null) return false;
   } else if (!arguments_in_use.equals(other.arguments_in_use)) return false;
   if (mapping == null) {
     if (other.mapping != null) return false;
   } else if (!mapping.equals(other.mapping)) return false;
   if (normal_form == null) {
     if (other.normal_form != null) return false;
   } else if (!normal_form.equals(other.normal_form)) return false;
   return true;
 }
  protected boolean hasCompatibleTypes(Collection<?> inputs, Collection<?> outputs) {
    MappingRoot typeMappingRoot = getTypeMappingRoot();
    if (typeMappingRoot != null) {
      Collection<Object> inputTypes = getTypeClassifiers(inputs);
      Collection<Object> outputTypes = getTypeClassifiers(outputs);

      if (inputTypes.equals(outputTypes)) return true;

      if (inputTypes.size() != inputs.size() || outputTypes.size() != outputs.size()) return false;

      if (getTypeMappings(inputTypes, outputTypes).isEmpty()
          && hasTypeMappings(inputTypes)
          && hasTypeMappings(outputTypes)) {
        return false;
      }
    }
    return true;
  }
Example #26
0
  /**
   * @param expVer Expected topology version.
   * @param curVer Current topology version.
   * @return {@code True} if cache affinity changed and operation should be remapped.
   */
  protected final boolean needRemap(
      AffinityTopologyVersion expVer, AffinityTopologyVersion curVer) {
    if (expVer.equals(curVer)) return false;

    Collection<ClusterNode> cacheNodes0 = ctx.discovery().cacheAffinityNodes(ctx.name(), expVer);
    Collection<ClusterNode> cacheNodes1 = ctx.discovery().cacheAffinityNodes(ctx.name(), curVer);

    if (!cacheNodes0.equals(cacheNodes1)
        || ctx.affinity().affinityTopologyVersion().compareTo(curVer) < 0) return true;

    try {
      List<List<ClusterNode>> aff1 = ctx.affinity().assignments(expVer);
      List<List<ClusterNode>> aff2 = ctx.affinity().assignments(curVer);

      return !aff1.equals(aff2);
    } catch (IllegalStateException e) {
      return true;
    }
  }
Example #27
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (!super.equals(obj)) return false;
   if (getClass() != obj.getClass()) return false;
   Empregado other = (Empregado) obj;
   if (competencia == null) {
     if (other.competencia != null) return false;
   } else if (!competencia.equals(other.competencia)) return false;
   if (dataAdmissao == null) {
     if (other.dataAdmissao != null) return false;
   } else if (!dataAdmissao.equals(other.dataAdmissao)) return false;
   if (dataDesligamento == null) {
     if (other.dataDesligamento != null) return false;
   } else if (!dataDesligamento.equals(other.dataDesligamento)) return false;
   if (matricula == null) {
     if (other.matricula != null) return false;
   } else if (!matricula.equals(other.matricula)) return false;
   if (situacao != other.situacao) return false;
   return true;
 }
Example #28
0
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof GitRepository)) {
      return false;
    }

    final GitRepository that = (GitRepository) o;

    if (alias != null ? !alias.equals(that.alias) : that.alias != null) {
      return false;
    }
    if (!environment.equals(that.environment)) {
      return false;
    }
    if (!publicURIs.equals(that.publicURIs)) {
      return false;
    }
    if (roles != null ? !roles.equals(that.roles) : that.roles != null) {
      return false;
    }
    if (root != null ? !root.equals(that.root) : that.root != null) {
      return false;
    }
    if (currentBranch != null
        ? !currentBranch.equals(that.currentBranch)
        : that.currentBranch != null) {
      return false;
    }
    if (branches != null ? !branches.equals(that.branches) : that.branches != null) {
      return false;
    }

    return true;
  }
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (!super.equals(obj)) return false;
   if (getClass() != obj.getClass()) return false;
   OAuth2Request other = (OAuth2Request) obj;
   if (approved != other.approved) return false;
   if (authorities == null) {
     if (other.authorities != null) return false;
   } else if (!authorities.equals(other.authorities)) return false;
   if (extensions == null) {
     if (other.extensions != null) return false;
   } else if (!extensions.equals(other.extensions)) return false;
   if (redirectUri == null) {
     if (other.redirectUri != null) return false;
   } else if (!redirectUri.equals(other.redirectUri)) return false;
   if (resourceIds == null) {
     if (other.resourceIds != null) return false;
   } else if (!resourceIds.equals(other.resourceIds)) return false;
   if (responseTypes == null) {
     if (other.responseTypes != null) return false;
   } else if (!responseTypes.equals(other.responseTypes)) return false;
   return true;
 }
Example #30
0
 @Override
 public boolean equals(Object o) {
   return collection.equals(o);
 }