Skip to content

Conversation

@XiXiongMaoXiong
Copy link
Contributor

@XiXiongMaoXiong XiXiongMaoXiong commented Nov 23, 2021

Check if a given input is a JSONObject or a JSONArray.

Code:

  1. isJSONObject(input)
/**
     * Checks if a given input is a JSONObject.
     *
     * @param input Anything.
     * @return true if it is a JSONObject.
     */
    public static <T> boolean isJSONObject(final T input) {
        return input instanceof JSONObject;
    }
  1. isJSONArray(input)
/**
     * Checks if a given input is a JSONArray
     *
     * @param input Anything.
     * @return true if it is a JSONArray.
     */
    public static <T> boolean isJSONArray(final T input) {
        return input instanceof JSONArray;
    }

Check if a given input is a JSONObject or a JSONArray.
@XiXiongMaoXiong
Copy link
Contributor Author

@Blankj you dead, lad?

@Dboy233
Copy link

Dboy233 commented Nov 26, 2021

He hasn't been online for a long time..
image

@XiXiongMaoXiong
Copy link
Contributor Author

He hasn't been online for a long time.. image

Probably getting bum-ra*ped by some Chinese prison warden somewhere in the PRC.

@Blankj Blankj merged commit f6ceb0f into Blankj:master Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants