Package com.segment.analytics.messages
Interface Message
-
- All Known Implementing Classes:
AliasMessage
,GroupMessage
,IdentifyMessage
,PageMessage
,ScreenMessage
,TrackMessage
public interface Message
Encapsulates properties common to all messages. Although not enforced by the compiler, either theanonymousId()
oruserId()
must be provided.For any functions that accept a map, such as
integrations()
,context()
,TrackMessage.properties()
,ScreenMessage.properties()
,IdentifyMessage.traits()
, orGroupMessage.traits()
, we'll make an internal copy of the map provided. If you use Guava, we'll use it'sImmutableMap#copyOf
methods instead.There are a few limitations to be aware of when using Guava — mainly that null keys or values are not permitted and duplicate keys are not permitted. For more details, refer to Guava's Javadocs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Message.Type
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
anonymousId()
java.util.Map<java.lang.String,?>
context()
java.util.Map<java.lang.String,java.lang.Object>
integrations()
java.lang.String
messageId()
java.util.Date
sentAt()
java.util.Date
timestamp()
Message.Type
type()
java.lang.String
userId()
-
-
-
Method Detail
-
type
@Nonnull Message.Type type()
-
messageId
@Nonnull java.lang.String messageId()
-
sentAt
@Nullable java.util.Date sentAt()
-
timestamp
@Nonnull java.util.Date timestamp()
-
context
@Nullable java.util.Map<java.lang.String,?> context()
-
anonymousId
@Nullable java.lang.String anonymousId()
-
userId
@Nullable java.lang.String userId()
-
integrations
@Nullable java.util.Map<java.lang.String,java.lang.Object> integrations()
-
-