Class Formatters


  • public final class Formatters
    extends Object
    • Method Detail

      • serializeFromList

        public static List<Map<String,​Object>> serializeFromList​(List<? extends Property> listProperty)
        Serialize a list of Property elements to a list of XDM formatted maps. Calls Property.serializeToXdm() on each element in the list.
        Parameters:
        listProperty - list of Property elements
        Returns:
        a list of Property elements serialized to XDM map structure
      • dateToISO8601String

        @Deprecated
        public static String dateToISO8601String​(Date timestamp)
        Deprecated.
        as of 2.0.0, replaced by TimeUtils.getISO8601UTCDateWithMilliseconds from Mobile Core
        Formats a Date to an ISO 8601 date-time string in UTC as defined in RFC 3339, section 5.6 For example, 2017-09-26T15:52:25Z
        Parameters:
        timestamp - a timestamp
        Returns:
        timestamp formatted to a string in the format of 'yyyy-MM-dd'T'HH:mm:ss'Z'', or an empty string if timestamp is null
      • dateToShortDateString

        @Deprecated
        public static String dateToShortDateString​(Date date)
        Deprecated.
        as of 2.0.0, replaced by TimeUtils.getISO8601FullDate from Mobile Core
        Formats a Date to a full-date string defined in RFC 3339, section 5.6, representing a date without time. For example, 2017-09-26
        Parameters:
        date - a date
        Returns:
        date formatted to a string in the format of 'yyy-MM-dd', or an empty string if date is null