Class PubSubMessage (1.5.5) 
  
      
     
  
  
  
   
  
    
  
  
    
    
    
  Version 1.5.5keyboard_arrow_down  
  
 
    
    
     
    
    
    
    
    
      
  
  
  
    
public   final   class  PubSubMessage   extends   GeneratedMessageV3   implements   PubSubMessageOrBuilder  
   
   A message that is published by publishers and delivered to subscribers.
 Protobuf type google.cloud.pubsublite.v1.PubSubMessage
 
  
  
  
  Static Fields
   
  ATTRIBUTES_FIELD_NUMBER 
  
    
public   static   final   int   ATTRIBUTES_FIELD_NUMBER  
   
  Field Value 
  
  DATA_FIELD_NUMBER 
  
    
public   static   final   int   DATA_FIELD_NUMBER  
   
  Field Value 
  
  EVENT_TIME_FIELD_NUMBER 
  
    
public   static   final   int   EVENT_TIME_FIELD_NUMBER  
   
  Field Value 
  
  KEY_FIELD_NUMBER 
  
    
public   static   final   int   KEY_FIELD_NUMBER  
   
  Field Value 
  
  Static Methods
   
   
  getDefaultInstance() 
  
    
public   static   PubSubMessage   getDefaultInstance ()  
   
  Returns 
  
   
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
   
  Returns 
  
   
  newBuilder() 
  
    
public   static   PubSubMessage . Builder   newBuilder ()  
   
  Returns 
  
   
  newBuilder(PubSubMessage prototype) 
  
    
public   static   PubSubMessage . Builder   newBuilder ( PubSubMessage   prototype )  
   
  Parameter 
  
  Returns 
  
   
  
  
    
public   static   PubSubMessage   parseDelimitedFrom ( InputStream   input )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   PubSubMessage   parseDelimitedFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(byte[] data) 
  
    
public   static   PubSubMessage   parseFrom ( byte []   data )  
   
  Parameter 
  
    
      
        Name  
        Description  
       
      
        data  
        byte [] 
       
     
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   PubSubMessage   parseFrom ( byte []   data ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteString data) 
  
    
public   static   PubSubMessage   parseFrom ( ByteString   data )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   PubSubMessage   parseFrom ( ByteString   data ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   PubSubMessage   parseFrom ( CodedInputStream   input )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   PubSubMessage   parseFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   PubSubMessage   parseFrom ( InputStream   input )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   PubSubMessage   parseFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteBuffer data) 
  
    
public   static   PubSubMessage   parseFrom ( ByteBuffer   data )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   PubSubMessage   parseFrom ( ByteBuffer   data ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parser() 
  
    
public   static   Parser<PubSubMessage>   parser ()  
   
  Returns 
  
  Methods
   
   
  containsAttributes(String key) 
  
    
public   boolean   containsAttributes ( String   key )  
   
   Optional attributes that can be used for message metadata/headers.
 map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
 
  Parameter 
  
  Returns 
  
   
  equals(Object obj) 
  
    
public   boolean   equals ( Object   obj )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  getAttributes() 
  
    
public   Map<String , AttributeValues >  getAttributes ()  
   
  
  Returns 
  
   
  getAttributesCount() 
  
    
public   int   getAttributesCount ()  
   
   Optional attributes that can be used for message metadata/headers.
 map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
 
  Returns 
  
   
  getAttributesMap() 
  
    
public   Map<String , AttributeValues >  getAttributesMap ()  
   
   Optional attributes that can be used for message metadata/headers.
 map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
 
  Returns 
  
   
  getAttributesOrDefault(String key, AttributeValues defaultValue) 
  
    
public   AttributeValues   getAttributesOrDefault ( String   key ,   AttributeValues   defaultValue )  
   
   Optional attributes that can be used for message metadata/headers.
 map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
 
  Parameters 
  
  Returns 
  
   
  getAttributesOrThrow(String key) 
  
    
public   AttributeValues   getAttributesOrThrow ( String   key )  
   
   Optional attributes that can be used for message metadata/headers.
 map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
 
  Parameter 
  
  Returns 
  
   
  getData() 
  
    
public   ByteString   getData ()  
   
   The payload of the message.
 bytes data = 2;
 
  Returns 
  
   
  getDefaultInstanceForType() 
  
    
public   PubSubMessage   getDefaultInstanceForType ()  
   
  Returns 
  
   
  getEventTime() 
  
    
public   Timestamp   getEventTime ()  
   
   An optional, user-specified event time.
 .google.protobuf.Timestamp event_time = 4;
 
  Returns 
  
   
  getEventTimeOrBuilder() 
  
    
public   TimestampOrBuilder   getEventTimeOrBuilder ()  
   
   An optional, user-specified event time.
 .google.protobuf.Timestamp event_time = 4;
 
  Returns 
  
   
  getKey() 
  
    
public   ByteString   getKey ()  
   
   The key used for routing messages to partitions or for compaction (e.g.,
 keep the last N messages per key). If the key is empty, the message is
 routed to an arbitrary partition.
 bytes key = 1;
 
  Returns 
  
   
  getParserForType() 
  
    
public   Parser<PubSubMessage>   getParserForType ()  
   
  Returns 
  
  Overrides 
  
   
  getSerializedSize() 
  
    
public   int   getSerializedSize ()  
   
  Returns 
  
  Overrides 
  
   
  getUnknownFields() 
  
    
public   final   UnknownFieldSet   getUnknownFields ()  
   
  Returns 
  
  Overrides 
  
   
  hasEventTime() 
  
    
public   boolean   hasEventTime ()  
   
   An optional, user-specified event time.
 .google.protobuf.Timestamp event_time = 4;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        boolean  
        Whether the eventTime field is set.
 
       
     
  
   
  hashCode() 
  
  Returns 
  
  Overrides 
  
   
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
   
  Returns 
  
  Overrides 
  
   
  internalGetMapField(int number) 
  
    
protected   MapField   internalGetMapField ( int   number )  
   
  Parameter 
  
    
      
        Name  
        Description  
       
      
        number  
        int  
       
     
  
  Returns 
  
  Overrides 
  
   
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
   
  Returns 
  
  Overrides 
  
   
  newBuilderForType() 
  
    
public   PubSubMessage . Builder   newBuilderForType ()  
   
  Returns 
  
   
  newBuilderForType(GeneratedMessageV3.BuilderParent parent) 
  
    
protected   PubSubMessage . Builder   newBuilderForType ( GeneratedMessageV3 . BuilderParent   parent )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  newInstance(GeneratedMessageV3.UnusedPrivateParameter unused) 
  
    
protected   Object   newInstance ( GeneratedMessageV3 . UnusedPrivateParameter   unused )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  toBuilder() 
  
    
public   PubSubMessage . Builder   toBuilder ()  
   
  Returns 
  
   
  writeTo(CodedOutputStream output) 
  
    
public   void   writeTo ( CodedOutputStream   output )  
   
  Parameter 
  
  Overrides 
  
  Exceptions 
  
 
     
    
  
  
  
     
  
 
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-30 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]