Tabnine Logo
Collection.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
java.util.Collection

Best Java code snippets using java.util.Collection.equals (Showing top 20 results out of 4,338)

origin: bumptech/glide

@Override
public boolean equals(Object o) {
 if (o instanceof MultiTransformation) {
  MultiTransformation<?> other = (MultiTransformation<?>) o;
  return transformations.equals(other.transformations);
 }
 return false;
}
origin: apache/flink

@Override
public boolean equals(Object obj) {
  if (obj == null) {
    return false;
  }
  if (obj instanceof FieldSet) {
    return this.collection.equals(((FieldSet) obj).collection);
  } else {
    return false;
  }
}
origin: apache/flink

@Override
public boolean equals(Object obj) {
  if (obj instanceof State) {
    @SuppressWarnings("unchecked")
    State<T> other = (State<T>) obj;
    return name.equals(other.name) &&
      stateType == other.stateType &&
      stateTransitions.equals(other.stateTransitions);
  } else {
    return false;
  }
}
origin: google/guava

@Override
public boolean equals(@Nullable Object obj) {
 if (obj instanceof InPredicate) {
  InPredicate<?> that = (InPredicate<?>) obj;
  return target.equals(that.target);
 }
 return false;
}
origin: google/guava

 public void testEquals_notACollection() {
  // noinspection EqualsBetweenInconvertibleTypes
  assertFalse(
    "A Collection should never equal an object that is not a Collection.",
    collection.equals("huh?"));
 }
}
origin: google/guava

public void testEquals_null() {
 // noinspection ObjectEqualsNull
 assertFalse("An object should not be equal to null.", collection.equals(null));
}
origin: google/guava

@SuppressWarnings("SelfEquals")
public void testEquals_self() {
 assertTrue("An Object should be equal to itself.", collection.equals(collection));
}
origin: apache/kafka

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  ConsumerGroupDescription that = (ConsumerGroupDescription) o;
  return isSimpleConsumerGroup == that.isSimpleConsumerGroup &&
    groupId.equals(that.groupId) &&
    members.equals(that.members) &&
    partitionAssignor.equals(that.partitionAssignor) &&
    state.equals(that.state);
}
origin: spring-projects/spring-framework

@Override
public boolean equals(@Nullable Object other) {
  if (this == other) {
    return true;
  }
  if (other == null || getClass() != other.getClass()) {
    return false;
  }
  return getContent().equals(((AbstractRequestCondition<?>) other).getContent());
}
origin: spring-projects/spring-framework

@Override
public boolean equals(@Nullable Object other) {
  if (this == other) {
    return true;
  }
  if (other == null || getClass() != other.getClass()) {
    return false;
  }
  return getContent().equals(((AbstractRequestCondition<?>) other).getContent());
}
origin: spring-projects/spring-framework

@Override
public boolean equals(@Nullable Object other) {
  if (this == other) {
    return true;
  }
  if (other == null || getClass() != other.getClass()) {
    return false;
  }
  return getContent().equals(((AbstractMessageCondition<?>) other).getContent());
}
origin: prestodb/presto

@Override
public boolean equals(@NullableDecl Object obj) {
 if (obj instanceof InPredicate) {
  InPredicate<?> that = (InPredicate<?>) obj;
  return target.equals(that.target);
 }
 return false;
}
origin: stanfordnlp/CoreNLP

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (!(o instanceof SemanticGraph)) {
  return false;
 }
 SemanticGraph g = (SemanticGraph) o;
 return graph.equals(g.graph) && roots.equals(g.roots);
}
origin: google/j2objc

@Override
public boolean equals(@NullableDecl Object obj) {
 if (obj instanceof InPredicate) {
  InPredicate<?> that = (InPredicate<?>) obj;
  return target.equals(that.target);
 }
 return false;
}
origin: stanfordnlp/CoreNLP

/**
 * Returns whether the given Datum contains the same features as this Datum.
 * Doesn't check the labels, should we change this?
 */
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object o) {
 if (!(o instanceof Datum)) {
  return (false);
 }
 Datum<LabelType, FeatureType> d = (Datum<LabelType, FeatureType>) o;
 return features.equals(d.asFeatures());
}
origin: google/guava

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")));
}
origin: neo4j/neo4j

private boolean propertyValuesEqual( Object expected, Object readValue )
{
  if ( expected.getClass().isArray() )
  {
    return arrayAsCollection( expected ).equals( arrayAsCollection( readValue ) );
  }
  return expected.equals( readValue );
}
origin: apache/incubator-shardingsphere

private boolean isSameShardingValue(final ListShardingValue shardingValue1, final ListShardingValue shardingValue2) {
  return isSameLogicTable(shardingValue1, shardingValue2)
      && shardingValue1.getColumnName().equals(shardingValue2.getColumnName()) && shardingValue1.getValues().equals(shardingValue2.getValues());
}

origin: google/guava

public void testEquals_sameType() {
 Collection<String> c = of("a", "b", "c");
 assertTrue(c.equals(of("a", "b", "c")));
 assertFalse(c.equals(of("a", "b", "d")));
}
origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
public boolean isModified() {
 return !getUserDefinedUrls().equals(myLibrariesService.getLibraryRootUrls()) ||
     myLibrariesService instanceof GoApplicationLibrariesService &&
     ((GoApplicationLibrariesService)myLibrariesService).isUseGoPathFromSystemEnvironment() !=
     myUseEnvGoPathCheckBox.isSelected();
}
java.utilCollectionequals

Javadoc

Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.

Popular methods of Collection

  • size
    Returns the number of elements in this collection. If this collection contains more than Integer.MAX
  • iterator
    Returns an iterator over the elements in this collection. There are no guarantees concerning the ord
  • add
  • isEmpty
    Returns true if this collection contains no elements.
  • contains
  • toArray
  • stream
  • addAll
  • forEach
  • remove
  • clear
  • removeAll
  • clear,
  • removeAll,
  • containsAll,
  • hashCode,
  • retainAll,
  • removeIf,
  • parallelStream,
  • spliterator,
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now