aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/References.java
blob: b75e591212d5aa32286e06e0e70bbc3bd196c4ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright (C) 2019, Matthias Sohn <matthias.sohn@sap.com> and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package org.eclipse.jgit.util;

/**
 * Utility methods for object references
 *
 * @since 5.4
 */
public interface References {

	/**
	 * Compare two references
	 *
	 * @param <T>
	 *            type of the references
	 * @param ref1
	 *            first reference
	 * @param ref2
	 *            second reference
	 * @return {@code true} if both references refer to the same object
	 */
	@SuppressWarnings("ReferenceEquality")
	public static <T> boolean isSameObject(T ref1, T ref2) {
		return ref1 == ref2;
	}
}