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

com.haoxuer.discover.user.oauth.impl.ElementUtils Maven / Gradle / Ivy

There is a newer version: 3.3.18-20230117
Show newest version
package com.haoxuer.discover.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