Beispiel #1
0
 /** @see java.lang.Object#equals(java.lang.Object) */
 @SuppressWarnings("unchecked")
 public boolean equals(Object msg) {
   if (msg == null) return false;
   COSTmsg<Val, U> msgCast = (COSTmsg<Val, U>) msg;
   return sender.equals(msgCast.sender)
       && receiver.equals(msgCast.receiver)
       && context.equals(msgCast.context)
       && lb.equals(msgCast.lb)
       && ub.equals(msgCast.ub);
 }
 @Override
 protected void check(U oldValue, U newValue) {
   try {
     if (currentIndex > assertedValues.length - 1) {
       fail();
       return;
     }
     if (newValue == null) {
       if (assertedValues[currentIndex] != null) {
         fail();
         return;
       }
       return;
     }
     if (assertedValues[currentIndex] == null) {
       fail();
       return;
     }
     if (!newValue.equals(assertedValues[currentIndex])) {
       fail();
       return;
     }
   } finally {
     currentIndex++;
   }
 }
Beispiel #3
0
 @Override
 public boolean equals(final Object obj) {
   if (obj instanceof Binome<?, ?>) {
     Binome<?, ?> bin = (Binome<?, ?>) obj;
     return one != null && one.equals(bin.getOne()) && two != null && two.equals(bin.getTwo());
   }
   return super.equals(obj);
 }
 @Override
 public boolean equals(Object obj) {
   if (!(obj instanceof HashableWeakReference)) return false;
   U referent = super.get();
   @SuppressWarnings("unchecked")
   Object other = ((HashableWeakReference<?>) obj).get();
   if (referent == null) return other == null;
   return referent.equals(other);
 }
Beispiel #5
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Pair pair = (Pair) o;

    return !(first != null ? !first.equals(pair.first) : pair.first != null)
        && !(second != null ? !second.equals(pair.second) : pair.second != null);
  }
Beispiel #6
0
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    Pair pair = (Pair) o;

    if (_1 != null ? !_1.equals(pair._1) : pair._1 != null) {
      return false;
    }
    if (_2 != null ? !_2.equals(pair._2) : pair._2 != null) {
      return false;
    }

    return true;
  }
 @Override
 protected boolean matches(Object item, Description mismatchDescription) {
   U actualValue = actualValue(item);
   mismatchDescription.appendText("was ").appendValue(actualValue);
   return expectedValue.equals(actualValue);
 }
 @Override
 public boolean equals(Object obj) {
   return referent.equals(obj);
 }