Class IEUtils


  • public abstract class IEUtils
    extends Object
    Utility functions for dealing with IEs
    • Constructor Detail

      • IEUtils

        public IEUtils()
    • 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 parse
        fieldName - 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 parse
        fieldName - 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 parse
        fieldName - 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 parse
        fieldName - 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 parse
        fieldName - 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 parse
        fieldName - the field name
        Returns:
        the field as a boolean (false if key not present)