Class UninitializedMessageException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.fusesource.hawtbuf.proto.UninitializedMessageException
- All Implemented Interfaces:
Serializable
Thrown when attempting to build a protocol message that is missing required
fields. This is a
RuntimeException because it normally represents a
programming error: it happens when some code which constructs a message fails
to set all the fields. parseFrom() methods do not throw this;
they throw an InvalidProtocolBufferException if required fields are
missing, because it is not a programming error to receive an incomplete
message. In other words, UninitializedMessageException should never
be thrown by correct code, but InvalidProtocolBufferException might
be.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts this exception to anInvalidProtocolBufferException.private static StringbuildDescription(List<String> missingFields) Construct the description string for this exception.Get a list of human-readable names of required fields missing from this message.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
missingFields
-
-
Constructor Details
-
UninitializedMessageException
-
-
Method Details
-
getMissingFields
-
asInvalidProtocolBufferException
Converts this exception to anInvalidProtocolBufferException. When a parsed message is missing required fields, this should be thrown instead ofUninitializedMessageException. -
buildDescription
-