1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

Add Objects.equals(Object, Object)

This commit is contained in:
Florian Schmaus 2018-05-09 12:37:09 +02:00
parent 455e083144
commit 09c6a9e2bc

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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) { public static <T> T requireNonNull(T obj) {
return requireNonNull(obj, null); return requireNonNull(obj, null);
} }
public static boolean equals(Object a, Object b) {
return a == b || (a != null && a.equals(b));
}
} }