Class BytesValue
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.protobuf.BytesValue
- All Implemented Interfaces:
BytesValueOrBuilder, Message, MessageLite, MessageLiteOrBuilder, MessageOrBuilder, Serializable
Wrapper message for `bytes`. The JSON representation for `BytesValue` is JSON string. Not recommended for use in new APIs, but still useful for legacy APIs and has no plan to be removed.Protobuf type
google.protobuf.BytesValue- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWrapper message for `bytes`.Nested classes/interfaces inherited from class GeneratedMessage
GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>, GeneratedMessage.ExtendableMessage<MessageT>, GeneratedMessage.ExtendableMessageOrBuilder<MessageT>, GeneratedMessage.ExtensionDescriptorRetriever, GeneratedMessage.FieldAccessorTable, GeneratedMessage.GeneratedExtension<ContainingT, T>, GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class AbstractMessage
AbstractMessage.BuilderParentNested classes/interfaces inherited from class AbstractMessageLite
AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BytesValueprivate byteprivate static final Parser<BytesValue> private static final longprivate ByteStringstatic final intFields inherited from class GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, PRE22_GENCODE_ERROR_PROPERTY, PRE22_GENCODE_SILENCE_PROPERTY, PRE22_GENCODE_VULNERABILITY_MESSAGE, unknownFieldsFields inherited from class AbstractMessage
memoizedSizeFields inherited from class AbstractMessageLite
memoizedHashCode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the specified object with this message for equality.static BytesValueGet an instance of the type with no fields set.static final Descriptors.DescriptorGet the message's type's descriptor.TODO: Remove this unnecessary intermediate implementation of this method.intGet the number of bytes required to encode this message.getValue()The bytes value.inthashCode()Returns the hash code value for this message.protected GeneratedMessage.FieldAccessorTableGet the FieldAccessorTable for this type.final booleanReturns true if all required fields in the message and all embedded messages are set, false otherwise.static BytesValue.Builderstatic BytesValue.BuildernewBuilder(BytesValue prototype) Constructs a new builder for a message of the same type as this message.protected BytesValue.BuilderCreate a nested builder.static BytesValueof(ByteString value) static BytesValueparseDelimitedFrom(InputStream input) static BytesValueparseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) static BytesValueparseFrom(byte[] data) static BytesValueparseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) static BytesValueparseFrom(ByteString data) static BytesValueparseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) static BytesValueparseFrom(CodedInputStream input) static BytesValueparseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) static BytesValueparseFrom(InputStream input) static BytesValueparseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) static BytesValueparseFrom(ByteBuffer data) static BytesValueparseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) static Parser<BytesValue> parser()Constructs a builder initialized with the current message.voidwriteTo(CodedOutputStream output) Serializes the message and writes it tooutput.Methods inherited from class GeneratedMessage
computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, enableAlwaysUseFieldBuildersForTesting, getAllFields, getAllFieldsRaw, getField, getFieldRaw, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, setAlwaysUseFieldBuildersForTesting, setUnknownFields, warnPre22Gencode, writeReplace, writeString, writeStringNoTagMethods inherited from class AbstractMessage
compareFields, findInitializationErrors, getInitializationErrorString, getMemoizedSerializedSize, hashFields, newUninitializedMessageException, setMemoizedSerializedSize, toStringMethods inherited from class AbstractMessageLite
addAll, checkByteStringIsUtf8, getSerializedSize, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
VALUE_FIELD_NUMBER
public static final int VALUE_FIELD_NUMBER- See Also:
-
value_
-
memoizedIsInitialized
private byte memoizedIsInitialized -
DEFAULT_INSTANCE
-
PARSER
-
-
Constructor Details
-
BytesValue
-
BytesValue
private BytesValue()
-
-
Method Details
-
getDescriptor
-
getDescriptorForType
Description copied from interface:MessageOrBuilderGet the message's type's descriptor. This differs from thegetDescriptor()method of generated message classes in that this method is an abstract method of theMessageinterface whereasgetDescriptor()is a static method of a specific class. They return the same thing.- Specified by:
getDescriptorForTypein interfaceMessageOrBuilder- Overrides:
getDescriptorForTypein classGeneratedMessage
-
internalGetFieldAccessorTable
Description copied from class:GeneratedMessageGet the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.- Specified by:
internalGetFieldAccessorTablein classGeneratedMessage
-
getValue
The bytes value.
bytes value = 1;- Specified by:
getValuein interfaceBytesValueOrBuilder- Returns:
- The value.
-
isInitialized
public final 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- Overrides:
isInitializedin classGeneratedMessage
-
writeTo
Description copied from interface:MessageLiteSerializes the message and writes it tooutput. This does not flush or close the stream.- Specified by:
writeToin interfaceMessageLite- Overrides:
writeToin classGeneratedMessage- Throws:
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. If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will be smaller than the actual number of bytes required and might be negative.- Specified by:
getSerializedSizein interfaceMessageLite- Overrides:
getSerializedSizein classGeneratedMessage
-
equals
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.- Specified by:
equalsin interfaceMessage- Overrides:
equalsin classAbstractMessage- Parameters:
obj- object to be compared for equality with this message- Returns:
trueif the specified object is equal to this message
-
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.- Specified by:
hashCodein interfaceMessage- Overrides:
hashCodein classAbstractMessage- Returns:
- the hash code value for this message
- See Also:
-
parseFrom
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static BytesValue parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException - Throws:
InvalidProtocolBufferException
-
parseFrom
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static BytesValue parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException - Throws:
InvalidProtocolBufferException
-
parseFrom
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static BytesValue parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException - Throws:
InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static BytesValue parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static BytesValue parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static BytesValue parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
Description copied from interface:MessageLiteConstructs a new builder for a message of the same type as this message.- Specified by:
newBuilderForTypein interfaceMessage- Specified by:
newBuilderForTypein interfaceMessageLite
-
newBuilder
-
newBuilder
-
toBuilder
Description copied from interface:MessageLiteConstructs a builder initialized with the current message. Use this to derive a new message from the current one.- Specified by:
toBuilderin interfaceMessage- Specified by:
toBuilderin interfaceMessageLite
-
newBuilderForType
Description copied from class:AbstractMessageCreate a nested builder.- Overrides:
newBuilderForTypein classAbstractMessage
-
getDefaultInstance
-
of
-
parser
-
getParserForType
Description copied from class:GeneratedMessageTODO: Remove this unnecessary intermediate implementation of this method.- Specified by:
getParserForTypein interfaceMessage- Specified by:
getParserForTypein interfaceMessageLite- Overrides:
getParserForTypein classGeneratedMessage
-
getDefaultInstanceForType
Description copied from interface:MessageLiteOrBuilderGet an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from thegetDefaultInstance()method of generated message classes in that this method is an abstract method of theMessageLiteinterface whereasgetDefaultInstance()is a static method of a specific class. They return the same thing.- Specified by:
getDefaultInstanceForTypein interfaceMessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfaceMessageOrBuilder
-