Class ValueConverter (3.7.0)

public class ValueConverter

Exposes utility methods for converting AI Platform messages to and from {Value } objects.

Inheritance

java.lang.Object > ValueConverter

Static Fields

EMPTY_VALUE

public static final Value EMPTY_VALUE

An empty {Value } message.

Field Value
TypeDescription
Value

Static Methods

fromValue(Message.Builder messageBuilder, Value value)

public static Message fromValue(Message.Builder messageBuilder, Value value)

Converts a {Value } to a {Message } of the provided {Message.Builder }.

Parameters
NameDescription
messageBuilderBuilder

a builder for the message type

valueValue

the Value to convert to a message

Returns
TypeDescription
Message

the value as a message

Exceptions
TypeDescription
InvalidProtocolBufferException

toValue(Message message)

public static Value toValue(Message message)

Converts a message type to a {Value }.

Parameter
NameDescription
messageMessage

the message to convert

Returns
TypeDescription
Value

the message as a {Value }

Exceptions
TypeDescription
InvalidProtocolBufferException

Constructors

ValueConverter()

public ValueConverter()