- java.lang.Object
-
- com.zerodeplibs.webpush.header.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 Summary
Fields Modifier and Type Field Description static StringHEADER_NAMEThe name of the Topic header field.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringensure(String topic)Makes sure that the given topic is no more than 32 characters from the URL and a filename-safe Base64 alphabet.
-
-
-
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,IllegalArgumentExceptionis thrown.- Parameters:
topic- a topic.- Returns:
- the same value as the given topic.
- Throws:
IllegalArgumentException- if the given topic doesn't meet the constraints.
-
-