Class RFC5545Util


  • public final class RFC5545Util
    extends Object
    • Constructor Detail

      • RFC5545Util

        public RFC5545Util()
    • Method Detail

      • getProdId

        public String getProdId()
        The product identifier PRODID, according to RFC 5545, 3.7.3.
        Returns:
        The product identifier.
      • foldContentLine

        public CharSequence foldContentLine​(Object p_firstLineOffset,
                                            Object p_value)
        Fold the given content line according to RFC 5545, 3.1.
        Parameters:
        p_firstLineOffset - The first line offset, either an integer, or a character sequence from which the length is taken.
        p_value - The content line. If this is null, or a value holder that does not contain a value, the line is assumed to be empty and no exception is thrown.
        Returns:
        The folded content line.
      • foldContentLineNotNull

        public CharSequence foldContentLineNotNull​(Object p_firstLineOffset,
                                                   Object p_value)
        Fold the given content line according to RFC 5545, 3.1.
        Parameters:
        p_firstLineOffset - The first line offset, either an integer, or a character sequence from which the length is taken.
        p_value - The content line. If this is null, or a value holder that does not contain a value, an IllegalArgumentException is thrown.
        Returns:
        The folded content line.
        Throws:
        IllegalArgumentException - If p_value is null, or a value holder that does not contain a value.
      • foldContentLine

        public CharSequence foldContentLine​(Object p_value)
        Fold the given content line according to RFC 5545, 3.1.
        Parameters:
        p_value - The content line. If this is null, or a value holder that does not contain a value, the line is assumed to be empty and no exception is thrown.
        Returns:
        The folded content line.
      • foldContentLineNotNull

        public CharSequence foldContentLineNotNull​(Object p_value)
        Fold the given content line according to RFC 5545, 3.1.
        Parameters:
        p_value - The content line. If this is null, or a value holder that does not contain a value, an IllegalArgumentException is thrown.
        Returns:
        The folded content line.
        Throws:
        IllegalArgumentException - If p_value is null, or a value holder that does not contain a value.
      • encodeText

        public CharSequence encodeText​(Object p_firstLineOffset,
                                       Object p_value)
        Encode text according to RFC 5545, 3.3.11.
        Parameters:
        p_firstLineOffset - The first line offset, either an integer, or a character sequence from which the length is taken.
        p_value - The text. If this is null, or a value holder that does not contain a value, the line is assumed to be empty and no exception is thrown.
        Returns:
        The encoded text.
      • encodeTextNotNull

        public CharSequence encodeTextNotNull​(Object p_firstLineOffset,
                                              Object p_value)
        Encode text according to RFC 5545, 3.3.11.
        Parameters:
        p_firstLineOffset - The first line offset, either an integer, or a character sequence from which the length is taken.
        p_value - The text. If this is null, or a value holder that does not contain a value, an IllegalArgumentException is thrown.
        Returns:
        The encoded text.
        Throws:
        IllegalArgumentException - If p_value is null, or a value holder that does not contain a value.
      • encodeText

        public CharSequence encodeText​(Object p_value)
        Encode text according to RFC 5545, 3.3.11.
        Parameters:
        p_value - The text. If this is null, or a value holder that does not contain a value, the line is assumed to be empty and no exception is thrown.
        Returns:
        The encoded text.
      • encodeTextNotNull

        public CharSequence encodeTextNotNull​(Object p_value)
        Encode text according to RFC 5545, 3.3.11.
        Parameters:
        p_value - The text. If this is null, or a value holder that does not contain a value, an IllegalArgumentException is thrown.
        Returns:
        The encoded text.
        Throws:
        IllegalArgumentException - If p_value is null, or a value holder that does not contain a value.
      • quotePropertyParameterValue

        public String quotePropertyParameterValue​(Object p_value)
        Quote the given property parameter value according to RFC 5545, 3.2, if necessary.
        Parameters:
        p_value - The property parameter value. If this is null, or a value holder that does not contain a value, the value is assumed to be empty and no exception is thrown.
        Returns:
        The optionally quoted property parameter value.
        Throws:
        IllegalArgumentException - If p_value is null, or a value holder that does not contain a value.
      • quotePropertyParameterValueNotNull

        public String quotePropertyParameterValueNotNull​(Object p_value)
        Quote the given property parameter value according to RFC 5545, 3.2, if necessary.
        Parameters:
        p_value - The property parameter value. If this is null, or a value holder that does not contain a value, an IllegalArgumentException is thrown.
        Returns:
        The optionally quoted property parameter value.
        Throws:
        IllegalArgumentException - If p_value is null, or a value holder that does not contain a value.
      • formatDateTimeLocal

        public String formatDateTimeLocal​(Object p_date,
                                          TimeZone p_tz)
        The format the given value, according to RFC 5545, FORM #1: DATE WITH LOCAL TIME.

        The method accepts

        • date objects,
        • timestamp objects,
        • value holders,
        • numbers, and
        • calendar objects
        as argument type.

        Parameters:
        p_date - An object that references a date.
        p_tz - The local time zone.
        Returns:
        The product identifier.
      • formatDateTimeLocalWithTimeZoneReference

        public String formatDateTimeLocalWithTimeZoneReference​(Object p_date,
                                                               TimeZone p_tz)
        The format the given value, according to RFC 5545, FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE.

        The method accepts

        • date objects,
        • timestamp objects,
        • value holders,
        • numbers, and
        • calendar objects
        as argument type.

        Parameters:
        p_date - An object that references a date.
        p_tz - The local time zone.
        Returns:
        The product identifier.
      • formatDateTimeUTC

        public String formatDateTimeUTC​(Object p_date)
        The format the given value, according to RFC 5545, FORM #2: DATE WITH UTC TIME.

        The method accepts

        • date objects,
        • timestamp objects,
        • value holders,
        • numbers, and
        • calendar objects
        as argument type.

        Parameters:
        p_date - An object that references a date.
        Returns:
        The product identifier.