public static final class Runtime.RawExtension extends com.google.protobuf.GeneratedMessageV3 implements Runtime.RawExtensionOrBuilder
RawExtension is used to hold extensions in external versions.
To use this, make a field which has RawExtension as its type in your external, versioned
struct, and Object in your internal struct. You also need to register your
various plugin types.
// Internal package:
type MyAPIObject struct {
runtime.TypeMeta `json:",inline"`
MyPlugin runtime.Object `json:"myPlugin"`
}
type PluginA struct {
AOption string `json:"aOption"`
}
// External package:
type MyAPIObject struct {
runtime.TypeMeta `json:",inline"`
MyPlugin runtime.RawExtension `json:"myPlugin"`
}
type PluginA struct {
AOption string `json:"aOption"`
}
// On the wire, the JSON will look something like this:
{
"kind":"MyAPIObject",
"apiVersion":"v1",
"myPlugin": {
"kind":"PluginA",
"aOption":"foo",
},
}
So what happens? Decode first uses json or yaml to unmarshal the serialized data into
your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.
The next step is to copy (using pkg/conversion) into the internal struct. The runtime
package's DefaultScheme has conversion functions installed which will unpack the
JSON stored in RawExtension, turning it into the correct object type, and storing it
in the Object. (TODO: In the case where the object is of an unknown type, a
runtime.Unknown object will be created and stored.)
+k8s:deepcopy-gen=true
+protobuf=true
+k8s:openapi-gen=true
Protobuf type k8s.io.apimachinery.pkg.runtime.RawExtension| Modifier and Type | Class and Description |
|---|---|
static class |
Runtime.RawExtension.Builder
RawExtension is used to hold extensions in external versions.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static com.google.protobuf.Parser<Runtime.RawExtension> |
PARSER
Deprecated.
|
static int |
RAW_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static Runtime.RawExtension |
getDefaultInstance() |
Runtime.RawExtension |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Parser<Runtime.RawExtension> |
getParserForType() |
com.google.protobuf.ByteString |
getRaw()
Raw is the underlying serialization of this object.
|
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasRaw()
Raw is the underlying serialization of this object.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Runtime.RawExtension.Builder |
newBuilder() |
static Runtime.RawExtension.Builder |
newBuilder(Runtime.RawExtension prototype) |
Runtime.RawExtension.Builder |
newBuilderForType() |
protected Runtime.RawExtension.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static Runtime.RawExtension |
parseDelimitedFrom(InputStream input) |
static Runtime.RawExtension |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Runtime.RawExtension |
parseFrom(byte[] data) |
static Runtime.RawExtension |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Runtime.RawExtension |
parseFrom(ByteBuffer data) |
static Runtime.RawExtension |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Runtime.RawExtension |
parseFrom(com.google.protobuf.ByteString data) |
static Runtime.RawExtension |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Runtime.RawExtension |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Runtime.RawExtension |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Runtime.RawExtension |
parseFrom(InputStream input) |
static Runtime.RawExtension |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Runtime.RawExtension> |
parser() |
Runtime.RawExtension.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newInstance, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int RAW_FIELD_NUMBER
@Deprecated public static final com.google.protobuf.Parser<Runtime.RawExtension> PARSER
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public boolean hasRaw()
Raw is the underlying serialization of this object. TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
optional bytes raw = 1;hasRaw in interface Runtime.RawExtensionOrBuilderpublic com.google.protobuf.ByteString getRaw()
Raw is the underlying serialization of this object. TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
optional bytes raw = 1;getRaw in interface Runtime.RawExtensionOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static Runtime.RawExtension parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Runtime.RawExtension parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Runtime.RawExtension parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Runtime.RawExtension parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Runtime.RawExtension parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Runtime.RawExtension parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Runtime.RawExtension parseFrom(InputStream input) throws IOException
IOExceptionpublic static Runtime.RawExtension parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Runtime.RawExtension parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static Runtime.RawExtension parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Runtime.RawExtension parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static Runtime.RawExtension parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic Runtime.RawExtension.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static Runtime.RawExtension.Builder newBuilder()
public static Runtime.RawExtension.Builder newBuilder(Runtime.RawExtension prototype)
public Runtime.RawExtension.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected Runtime.RawExtension.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static Runtime.RawExtension getDefaultInstance()
public static com.google.protobuf.Parser<Runtime.RawExtension> parser()
public com.google.protobuf.Parser<Runtime.RawExtension> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public Runtime.RawExtension getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2020. All rights reserved.