Package com.facebook.openwifi.cloudsdk
Class IEUtils
- java.lang.Object
-
- com.facebook.openwifi.cloudsdk.IEUtils
-
public abstract class IEUtils extends Object
Utility functions for dealing with IEs
-
-
Constructor Summary
Constructors Constructor Description IEUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
parseBooleanNumberField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a boolean when represented as a number (0, 1)static Integer
parseIntField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a intstatic Byte
parseOptionalByteField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a bytestatic Integer
parseOptionalIntField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a intstatic Short
parseOptionalShortField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a shortstatic String
parseOptionalStringField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a string
-
-
-
Method Detail
-
parseOptionalByteField
public static Byte parseOptionalByteField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a byte- Parameters:
contents
- the JSON object to try to parsefieldName
- the field name- Returns:
- the field as a byte or null
-
parseOptionalShortField
public static Short parseOptionalShortField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a short- Parameters:
contents
- the JSON object to try to parsefieldName
- the field name- Returns:
- the field as a short or null
-
parseOptionalIntField
public static Integer parseOptionalIntField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a int- Parameters:
contents
- the JSON object to try to parsefieldName
- the field name- Returns:
- the field as a int or null
-
parseIntField
public static Integer parseIntField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a int- Parameters:
contents
- the JSON object to try to parsefieldName
- the field name- Returns:
- the field as a int (0 if key not present)
-
parseOptionalStringField
public static String parseOptionalStringField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a string- Parameters:
contents
- the JSON object to try to parsefieldName
- the field name- Returns:
- the field as a string or null
-
parseBooleanNumberField
public static boolean parseBooleanNumberField(com.google.gson.JsonObject contents, String fieldName)
Try to get a json object as a boolean when represented as a number (0, 1)- Parameters:
contents
- the JSON object to try to parsefieldName
- the field name- Returns:
- the field as a boolean (false if key not present)
-
-