- java.lang.Object
-
- com.zerodeplibs.webpush.PushMessage
-
public class PushMessage extends Object
This class represents a push message to be encrypted.
Thread Safety:Instances of this class are immutable. So they are thread-safe.
- Author:
- Tomoki Sato
- See Also:
MessageEncryption
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Compares the given object with this object based on their underlying messages.inthashCode()Returns the hash code value for this object based on its underlying message.static PushMessageof(byte[] messageBytes)Creates a newPushMessagewith the given octet sequence.static PushMessageofUTF8(String messageText)Creates a newPushMessagewith the given text.StringtoString()
-
-
-
Method Detail
-
of
public static PushMessage of(byte[] messageBytes)
Creates a newPushMessagewith the given octet sequence.- Parameters:
messageBytes- the octet sequence representing a push message.- Returns:
- a new
PushMessage. - Throws:
IllegalArgumentException- if the given octet sequence is null or empty.
-
ofUTF8
public static PushMessage ofUTF8(String messageText)
Creates a newPushMessagewith the given text. The given text is encoded by using UTF-8.- Parameters:
messageText- the text representing a push message.- Returns:
- a new
PushMessage. - Throws:
IllegalArgumentException- if the given text is null or empty.
-
equals
public boolean equals(Object o)
Compares the given object with this object based on their underlying messages.
-
hashCode
public int hashCode()
Returns the hash code value for this object based on its underlying message.
-
-