Add Objects.equals(Object, Object)

This commit is contained in:
Florian Schmaus 2018-05-09 12:37:09 +02:00
parent 455e083144
commit 09c6a9e2bc
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,6 @@
/**
*
* Copyright 2015 Florian Schmaus
* Copyright 2015-2018 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,4 +28,8 @@ public class Objects {
public static <T> T requireNonNull(T obj) {
return requireNonNull(obj, null);
}
public static boolean equals(Object a, Object b) {
return a == b || (a != null && a.equals(b));
}
}