Java V1 Example

Introduction

The java v1 example is extracted from the most popular open source projects, you can refer to the following example for usage.

Programming language: Java

Class/type: V1

Example#1
File: Tuple.javaProject: jp96/elasticsearch

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Tuple tuple = (Tuple) o;

    if (v1 != null ? !v1.equals(tuple.v1) : tuple.v1 != null) return false;
    if (v2 != null ? !v2.equals(tuple.v2) : tuple.v2 != null) return false;

    return true;
  }

Example#2
File: Tuple.javaProject: jp96/elasticsearch

 @Override
 public int hashCode() {
   int result = v1 != null ? v1.hashCode() : 0;
   result = 31 * result + (v2 != null ? v2.hashCode() : 0);
   return result;
 }