mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Add Objects.equals(Object, Object)
This commit is contained in:
parent
455e083144
commit
09c6a9e2bc
1 changed files with 5 additions and 1 deletions
|
@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue