Skip to content

Instantly share code, notes, and snippets.

@git-init-wesley
Last active April 20, 2020 14:28
Show Gist options
  • Save git-init-wesley/81b08ae88420104ac3648a82133c7e2f to your computer and use it in GitHub Desktop.
Save git-init-wesley/81b08ae88420104ac3648a82133c7e2f to your computer and use it in GitHub Desktop.
This method test an Object _o if is Objects::isNull and return Object _c if true or return Object _o.
/**
* This method test an {@link Object} {@param _o} if is {@link Objects::isNull} and return {@link Object} {@param _c} if true or return {@link Object} {@param _o}.
* @param _o Tested {@link Object}
* @param _r Return If {@param _o} is {@link Objects::isNull}
* @return _o Return If {@param _o} is !{@link Objects::isNull}
*/
public static Object _a(Object _o, Object _r) {
if (Objects.isNull(_o)) return _r;
return _o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment