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

How to use
equals
method
in
java.util.List

Best Java code snippets using java.util.List.equals (Showing top 20 results out of 33,489)

origin: spring-projects/spring-framework

@Override
public boolean equals(Object other) {
  return (this == other || (other instanceof MutablePropertyValues &&
      this.propertyValueList.equals(((MutablePropertyValues) other).propertyValueList)));
}
origin: square/okhttp

@Override public boolean equals(@Nullable Object other) {
 if (!(other instanceof Handshake)) return false;
 Handshake that = (Handshake) other;
 return tlsVersion.equals(that.tlsVersion)
   && cipherSuite.equals(that.cipherSuite)
   && peerCertificates.equals(that.peerCertificates)
   && localCertificates.equals(that.localCertificates);
}
origin: google/guava

 @Override
 public boolean equals(@Nullable Object o) {
  if (o instanceof MethodIdentifier) {
   MethodIdentifier ident = (MethodIdentifier) o;
   return name.equals(ident.name) && parameterTypes.equals(ident.parameterTypes);
  }
  return false;
 }
}
origin: google/guava

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

@Override
public boolean equals(Object obj) {
 if (obj instanceof TypeParameterSignature) {
  TypeParameterSignature other = (TypeParameterSignature) obj;
  /*
   * The name is here only for display purposes; <E extends Number> and <T
   * extends Number> are equivalent.
   */
  return bounds.equals(other.bounds);
 }
 return false;
}
origin: google/guava

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

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 synchronized (mutex) {
  return delegate().equals(o);
 }
}
origin: google/guava

@Override
public boolean equals(Object obj) {
 if (obj instanceof TypeSignature) {
  TypeSignature other = (TypeSignature) obj;
  return parameterSignatures.equals(other.parameterSignatures);
 }
 return false;
}
origin: spring-projects/spring-framework

@Override
public List<MediaType> resolveMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException {
  for (ContentNegotiationStrategy strategy : this.strategies) {
    List<MediaType> mediaTypes = strategy.resolveMediaTypes(request);
    if (mediaTypes.equals(MEDIA_TYPE_ALL_LIST)) {
      continue;
    }
    return mediaTypes;
  }
  return MEDIA_TYPE_ALL_LIST;
}
origin: square/okhttp

boolean equalsNonHost(Address that) {
 return this.dns.equals(that.dns)
   && this.proxyAuthenticator.equals(that.proxyAuthenticator)
   && this.protocols.equals(that.protocols)
   && this.connectionSpecs.equals(that.connectionSpecs)
   && this.proxySelector.equals(that.proxySelector)
   && Objects.equals(this.proxy, that.proxy)
   && Objects.equals(this.sslSocketFactory, that.sslSocketFactory)
   && Objects.equals(this.hostnameVerifier, that.hostnameVerifier)
   && Objects.equals(this.certificatePinner, that.certificatePinner)
   && this.url().port() == that.url().port();
}
origin: google/guava

 @Override
 public String toString() {
  return (bounds.equals(ImmutableList.of(Object.class)))
    ? name
    : name + " extends " + getTypesString(bounds);
 }
}
origin: google/guava

@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherListContainingNull() {
 List<E> other = new ArrayList<>(getSampleElements());
 other.set(other.size() / 2, null);
 assertFalse(
   "Two Lists should not be equal if exactly one of them has null at a given index.",
   getList().equals(other));
}
origin: google/guava

public void testEquals_otherListWithSameElements() {
 assertTrue(
   "A List should equal any other List containing the same elements.",
   getList().equals(new ArrayList<E>(getOrderedElements())));
}
origin: google/guava

@CollectionSize.Require(absent = CollectionSize.ZERO)
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
public void testEquals_containingNull() {
 ArrayList<E> elements = new ArrayList<>(getSampleElements());
 elements.set(elements.size() / 2, null);
 collection = getSubjectGenerator().create(elements.toArray());
 List<E> other = new ArrayList<>(getSampleElements());
 assertFalse(
   "Two Lists should not be equal if exactly one of them has null at a given index.",
   getList().equals(other));
}
origin: google/guava

public void testEquals_longerList() {
 Collection<E> moreElements = getSampleElements(getNumElements() + 1);
 assertFalse(
   "Lists of different sizes should not be equal.",
   getList().equals(new ArrayList<E>(moreElements)));
}
origin: google/guava

@Override
public boolean equals(Object obj) {
 if (obj instanceof MethodSignature) {
  MethodSignature other = (MethodSignature) obj;
  return name.equals(other.name)
    && parameterTypes.equals(other.parameterTypes)
    && typeSignature.equals(other.typeSignature);
 }
 return false;
}
origin: google/guava

@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherListWithDifferentElements() {
 ArrayList<E> other = new ArrayList<>(getSampleElements());
 other.set(other.size() / 2, getSubjectGenerator().samples().e3());
 assertFalse(
   "A List should not equal another List containing different elements.",
   getList().equals(other));
}
origin: google/guava

@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_shorterList() {
 Collection<E> fewerElements = getSampleElements(getNumElements() - 1);
 assertFalse(
   "Lists of different sizes should not be equal.",
   getList().equals(new ArrayList<E>(fewerElements)));
}
origin: google/guava

public void testAsListEquals() {
 assertEquals(Booleans.asList(EMPTY), Collections.emptyList());
 assertEquals(Booleans.asList(ARRAY_FALSE), Booleans.asList(ARRAY_FALSE));
 assertFalse(Booleans.asList(ARRAY_FALSE).equals(ARRAY_FALSE));
 assertFalse(Booleans.asList(ARRAY_FALSE).equals(null));
 assertFalse(Booleans.asList(ARRAY_FALSE).equals(Booleans.asList(ARRAY_FALSE_TRUE)));
 assertFalse(Booleans.asList(ARRAY_FALSE_FALSE).equals(Booleans.asList(ARRAY_FALSE_TRUE)));
 assertEquals(1, Booleans.asList(ARRAY_FALSE_TRUE).lastIndexOf(true));
 List<Boolean> reference = Booleans.asList(ARRAY_FALSE);
 assertEquals(Booleans.asList(ARRAY_FALSE), reference);
 assertEquals(reference, reference);
}
origin: spring-projects/spring-framework

@Test
public void varyBy() {
  Mono<ServerResponse> result = ServerResponse.ok().varyBy("foo").build();
  List<String> expected = Collections.singletonList("foo");
  StepVerifier.create(result)
      .expectNextMatches(response -> expected.equals(response.headers().getVary()))
      .expectComplete()
      .verify();
}
java.utilListequals

Javadoc

Compares the given object with the List, and returns true if they represent the same object using a class specific comparison. For Lists, this means that they contain the same elements in exactly the same order.

Popular methods of List

  • add
  • size
    Returns the number of elements in this List.
  • get
    Returns the element at the specified location in this List.
  • isEmpty
    Returns whether this List contains no elements.
  • addAll
  • toArray
    Returns an array containing all elements contained in this List. If the specified array is large eno
  • contains
    Tests whether this List contains the specified object.
  • remove
    Removes the first occurrence of the specified object from this List.
  • iterator
    Returns an iterator on the elements of this List. The elements are iterated in the same order as the
  • clear
  • stream
  • forEach
  • stream,
  • forEach,
  • set,
  • subList,
  • indexOf,
  • hashCode,
  • removeAll,
  • listIterator,
  • sort

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top Vim plugins
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