Package akka.protobuf
Class AbstractMessage
- java.lang.Object
-
- akka.protobuf.AbstractMessageLite
-
- akka.protobuf.AbstractMessage
-
- All Implemented Interfaces:
Message,MessageLite,MessageLiteOrBuilder,MessageOrBuilder
- Direct Known Subclasses:
DynamicMessage,GeneratedMessage
public abstract class AbstractMessage extends AbstractMessageLite implements Message
A partial implementation of theMessageinterface which implements as many methods of that interface as possible in terms of other methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractMessage.Builder<BuilderType extends AbstractMessage.Builder>A partial implementation of theMessage.Builderinterface which implements as many methods of that interface as possible in terms of other methods.
-
Constructor Summary
Constructors Constructor Description AbstractMessage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Compares the specified object with this message for equality.java.util.List<java.lang.String>findInitializationErrors()Returns a list of field paths (e.g.java.lang.StringgetInitializationErrorString()Returns a comma-delimited list of required fields which are not set in this message object.intgetSerializedSize()Get the number of bytes required to encode this message.protected static inthashBoolean(boolean b)Helper method for implementingMessage.hashCode().inthashCode()Returns the hash code value for this message.protected static inthashEnum(Internal.EnumLite e)Helper method for implementingMessage.hashCode().protected static inthashEnumList(java.util.List<? extends Internal.EnumLite> list)Helper method for implementingMessage.hashCode().protected inthashFields(int hash, java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> map)Get a hash code for given fields and values, using the given seed.protected static inthashLong(long n)Helper method for implementingMessage.hashCode().booleanisInitialized()Returns true if all required fields in the message and all embedded messages are set, false otherwise.java.lang.StringtoString()Converts the message to a string in protocol buffer text format.voidwriteTo(CodedOutputStream output)Serializes the message and writes it tooutput.-
Methods inherited from class akka.protobuf.AbstractMessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.protobuf.Message
getParserForType, newBuilderForType, toBuilder
-
Methods inherited from interface akka.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from interface akka.protobuf.MessageOrBuilder
getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField
-
-
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
Description copied from interface:MessageLiteOrBuilderReturns true if all required fields in the message and all embedded messages are set, false otherwise.- Specified by:
isInitializedin interfaceMessageLiteOrBuilder
-
findInitializationErrors
public java.util.List<java.lang.String> findInitializationErrors()
Description copied from interface:MessageOrBuilderReturns a list of field paths (e.g. "foo.bar.baz") of required fields which are not set in this message. You should callMessageLiteOrBuilder.isInitialized()first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.- Specified by:
findInitializationErrorsin interfaceMessageOrBuilder
-
getInitializationErrorString
public java.lang.String getInitializationErrorString()
Description copied from interface:MessageOrBuilderReturns a comma-delimited list of required fields which are not set in this message object. You should callMessageLiteOrBuilder.isInitialized()first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.- Specified by:
getInitializationErrorStringin interfaceMessageOrBuilder
-
toString
public final java.lang.String toString()
Description copied from interface:MessageConverts the message to a string in protocol buffer text format. This is just a trivial wrapper aroundTextFormat.printToString(MessageOrBuilder).
-
writeTo
public void writeTo(CodedOutputStream output) throws java.io.IOException
Description copied from interface:MessageLiteSerializes the message and writes it tooutput. This does not flush or close the stream.- Specified by:
writeToin interfaceMessageLite- Throws:
java.io.IOException
-
getSerializedSize
public int getSerializedSize()
Description copied from interface:MessageLiteGet the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.- Specified by:
getSerializedSizein interfaceMessageLite
-
equals
public boolean equals(java.lang.Object other)
Description copied from interface:MessageCompares the specified object with this message for equality. Returnstrueif the given object is a message of the same type (as defined bygetDescriptorForType()) and has identical values for all of its fields. Subclasses must implement this; inheritingObject.equals()is incorrect.
-
hashCode
public int hashCode()
Description copied from interface:MessageReturns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheritingObject.hashCode()is incorrect.
-
hashFields
protected int hashFields(int hash, java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> map)Get a hash code for given fields and values, using the given seed.
-
hashLong
protected static int hashLong(long n)
Helper method for implementingMessage.hashCode().- See Also:
Boolean.hashCode()
-
hashBoolean
protected static int hashBoolean(boolean b)
Helper method for implementingMessage.hashCode().- See Also:
Boolean.hashCode()
-
hashEnum
protected static int hashEnum(Internal.EnumLite e)
Helper method for implementingMessage.hashCode().This is needed because
Enum.hashCode()is final, but we need to use the field number as the hash code to ensure compatibility between statically and dynamically generated enum objects.
-
hashEnumList
protected static int hashEnumList(java.util.List<? extends Internal.EnumLite> list)
Helper method for implementingMessage.hashCode().
-
-