com.google.protobuf.gwt.shared
Interface Message.Builder

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AbstractMessage.Builder, GeneratedMessage.Builder, RequestResponse.ClientConfiguration.Builder, RequestResponse.GraphDataRequest.Builder, RequestResponse.LoadMainPanelResponse.Builder, RequestResponse.Request.Builder, RequestResponse.Response.Builder, RequestResponse.TierLatencyObj.Builder, RequestResponse.TierLatencyResponse.Builder, RequestResponse.TimeLineGraphResponse.Builder, RequestResponse.TopologyDataResponse.Builder
Enclosing interface:
Message

public static interface Message.Builder
extends Cloneable

Abstract interface implemented by Protocol Message builders.


Method Summary
 Message build()
          Construct the final message.
 Message buildPartial()
          Like build(), but does not throw an exception if the message is missing required fields.
 Message.Builder clear()
          Resets all fields to their default values.
 Message.Builder clone()
          Clones the Builder.
 Message getDefaultInstanceForType()
          Get the message's type's default instance.
 boolean isInitialized()
          Returns true if all required fields in the message and all embedded messages are set, false otherwise.
 Message.Builder mergeFrom(Message other)
          Merge other into the message being built.
 Message.Builder readFrom(JsonStream input)
          Merge input into the message being built.
 

Method Detail

clear

Message.Builder clear()
Resets all fields to their default values.


mergeFrom

Message.Builder mergeFrom(Message other)
Merge other into the message being built. other must have the exact same type as this.

Merging occurs as follows. For each field:
* For singular primitive fields, if the field is set in other, then other's value overwrites the value in this message.
* For singular message fields, if the field is set in other, it is merged into the corresponding sub-message of this message using the same merging rules.
* For repeated fields, the elements in other are concatenated with the elements in this message.

This is equivalent to the Message::MergeFrom method in C++.


readFrom

Message.Builder readFrom(JsonStream input)
                         throws IOException
Merge input into the message being built.

Throws:
IOException

build

Message build()
Construct the final message. Once this is called, the Builder is no longer valid, and calling any other method will result in undefined behavior and may throw a NullPointerException. If you need to continue working with the builder after calling build(), clone() it first.

Throws:
UninitializedMessageException - The message is missing one or more required fields (i.e. isInitialized() returns false) . Use buildPartial() to bypass this check.

buildPartial

Message buildPartial()
Like build(), but does not throw an exception if the message is missing required fields. Instead, a partial message is returned. Once this is called, the Builder is no longer valid, and calling any will result in undefined behavior and may throw a NullPointerException.

If you need to continue working with the builder after calling buildPartial(), clone() it first.


clone

Message.Builder clone()
Clones the Builder.

See Also:
Object.clone()

isInitialized

boolean isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false otherwise.


getDefaultInstanceForType

Message getDefaultInstanceForType()
Get the message's type's default instance. See Message.getDefaultInstanceForType().



Copyright © 2014 InMobi. All rights reserved.