Class Topic


  • public class Topic
    extends Object

    The utility class used for setting the Topic header field.

    Example:
     // Makes sure the "Topic" header field doesn't contain illegal characters
     // and the length doesn't exceed the limit.
     // (no more than 32 characters from the URL and a filename-safe Base 64 alphabet).
     myHeader.addHeader("Topic", Topic.ensure("SomeTopic"));
     
    Author:
    Tomoki Sato
    • Field Detail

      • HEADER_NAME

        public static String HEADER_NAME
        The name of the Topic header field.
    • Method Detail

      • ensure

        public static String ensure​(String topic)
        Makes sure that the given topic is no more than 32 characters from the URL and a filename-safe Base64 alphabet. If the given topic doesn't meet these constraints, IllegalArgumentException is thrown.
        Parameters:
        topic - a topic.
        Returns:
        the same value as the given topic.
        Throws:
        IllegalArgumentException - if the given topic doesn't meet the constraints.