Java Code Examples for java8.util.Objects#isNull()

The following examples show how to use java8.util.Objects#isNull() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MatrixJsonObject.java    From matrix-java-sdk with GNU Affero General Public License v3.0 5 votes vote down vote up
public MatrixJsonObject(JsonObject obj) {
    if (Objects.isNull(obj)) {
        throw new InvalidJsonException("JSON Object is null");
    }

    this.obj = obj;
}
 
Example 2
Source File: MatrixClientContext.java    From matrix-java-sdk with GNU Affero General Public License v3.0 5 votes vote down vote up
public _MatrixHomeserver getHomeserver() {
    if (Objects.isNull(hsBaseUrl)) {
        throw new IllegalStateException("Homeserver Base URL is not set");
    }

    return new MatrixHomeserver(domain, hsBaseUrl.toString());
}
 
Example 3
Source File: BasicObjectsTest.java    From streamsupport with GNU General Public License v2.0 5 votes vote down vote up
private static int testIsNull() {
    int errors = 0;

    errors += Objects.isNull(null) ? 0 : 1;
    errors += Objects.isNull(Objects.class) ? 1 : 0;

    return errors;
}