All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quhaodian.user.oauth.impl.ElementUtils Maven / Gradle / Ivy

There is a newer version: 1.8.31
Show newest version
package com.quhaodian.user.oauth.impl;

import com.google.gson.JsonElement;

public class ElementUtils {

  public static String getString(JsonElement element, String key) {

    String result = "";
    try {
      result = element.getAsJsonObject().get(key).getAsString();
    } catch (Exception e2) {
    }

    return result;
  }

  public static Integer getInt(JsonElement element, String key) {

    Integer result = 0;
    try {
      result = element.getAsJsonObject().get(key).getAsInt();
    } catch (Exception e2) {
    }
    return result;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy