Package dev.cel.runtime
Class PartialMessage
- java.lang.Object
-
- dev.cel.runtime.PartialMessage
-
- All Implemented Interfaces:
MessageLiteOrBuilder,MessageOrBuilder,IncompleteData,PartialMessageOrBuilder
@Deprecated @Internal public class PartialMessage extends java.lang.Object implements PartialMessageOrBuilder, IncompleteData
Deprecated.Wrap a Message to throw an error on access to certain fields or sub-fields, as described by a FieldMask.Deprecated. New clients should use
CelAttributebased unknowns.
-
-
Constructor Summary
Constructors Constructor Description PartialMessage(Message m)Deprecated.PartialMessage(Message m, FieldMask mask)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.List<java.lang.String>findInitializationErrors()Deprecated.Returns a list of field paths (e.g.java.util.Map<Descriptors.FieldDescriptor,java.lang.Object>getAllFields()Deprecated.Returns a collection of all the fields in this message which are set and their corresponding values.MessagegetDefaultInstanceForType()Deprecated.Get an instance of the type with no fields set.Descriptors.DescriptorgetDescriptorForType()Deprecated.Get the message's type's descriptor.java.lang.ObjectgetField(Descriptors.FieldDescriptor field)Deprecated.This method is similar toMessageOrBuilder.getField(FieldDescriptor), with the following differences: This method may throw an InterpreterException wrapped with a RuntimeException, if the field path is set in the Field mask.FieldMaskgetFieldMask()Deprecated.java.lang.StringgetInitializationErrorString()Deprecated.Returns a comma-delimited list of required fields which are not set in this message object.MessagegetMessage()Deprecated.Return original message.Descriptors.FieldDescriptorgetOneofFieldDescriptor(Descriptors.OneofDescriptor oneof)Deprecated.Obtains the FieldDescriptor if the given oneof is set.java.lang.ObjectgetRepeatedField(Descriptors.FieldDescriptor field, int index)Deprecated.Gets an element of a repeated field.intgetRepeatedFieldCount(Descriptors.FieldDescriptor field)Deprecated.Gets the number of elements of a repeated field.UnknownFieldSetgetUnknownFields()Deprecated.Get theUnknownFieldSetfor this message.booleanhasField(Descriptors.FieldDescriptor field)Deprecated.Returns true if the given field is set.booleanhasOneof(Descriptors.OneofDescriptor oneof)Deprecated.Returns true if the given oneof is set.booleanisInitialized()Deprecated.Returns true if all required fields in the message and all embedded messages are set, false otherwise.java.lang.StringtoString()Deprecated.
-
-
-
Method Detail
-
getDefaultInstanceForType
public Message getDefaultInstanceForType()
Deprecated.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
-
isInitialized
public boolean isInitialized()
Deprecated.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
-
findInitializationErrors
public java.util.List<java.lang.String> findInitializationErrors()
Deprecated.Description copied from interface:MessageOrBuilderReturns a list of field paths (e.g. "foo.bar.baz") of required fields which are not set in this message. You should callMessageLiteOrBuilder.isInitialized()first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.- Specified by:
findInitializationErrorsin interfaceMessageOrBuilder
-
getInitializationErrorString
public java.lang.String getInitializationErrorString()
Deprecated.Description copied from interface:MessageOrBuilderReturns a comma-delimited list of required fields which are not set in this message object. You should callMessageLiteOrBuilder.isInitialized()first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.- Specified by:
getInitializationErrorStringin interfaceMessageOrBuilder
-
getDescriptorForType
public Descriptors.Descriptor getDescriptorForType()
Deprecated.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
-
getAllFields
public java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> getAllFields()
Deprecated.Description copied from interface:MessageOrBuilderReturns a collection of all the fields in this message which are set and their corresponding values. A singular ("required" or "optional") field is set iff hasField() returns true for that field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values are exactly what would be returned by callingMessageOrBuilder.getField(Descriptors.FieldDescriptor)for each field. The map is guaranteed to be a sorted map, so iterating over it will return fields in order by field number.
If this is for a builder, the returned map may or may not reflect future changes to the builder. Either way, the returned map is itself unmodifiable.- Specified by:
getAllFieldsin interfaceMessageOrBuilder
-
hasOneof
public boolean hasOneof(Descriptors.OneofDescriptor oneof)
Deprecated.Description copied from interface:MessageOrBuilderReturns true if the given oneof is set.- Specified by:
hasOneofin interfaceMessageOrBuilder
-
getOneofFieldDescriptor
public Descriptors.FieldDescriptor getOneofFieldDescriptor(Descriptors.OneofDescriptor oneof)
Deprecated.Description copied from interface:MessageOrBuilderObtains the FieldDescriptor if the given oneof is set. Returns null if no field is set.- Specified by:
getOneofFieldDescriptorin interfaceMessageOrBuilder
-
hasField
public boolean hasField(Descriptors.FieldDescriptor field)
Deprecated.Description copied from interface:MessageOrBuilderReturns true if the given field is set. This is exactly equivalent to calling the generated "has" accessor method corresponding to the field.- Specified by:
hasFieldin interfaceMessageOrBuilder
-
getField
public java.lang.Object getField(Descriptors.FieldDescriptor field)
Deprecated.Description copied from interface:PartialMessageOrBuilderThis method is similar toMessageOrBuilder.getField(FieldDescriptor), with the following differences: This method may throw an InterpreterException wrapped with a RuntimeException, if the field path is set in the Field mask.- Specified by:
getFieldin interfaceMessageOrBuilder- Specified by:
getFieldin interfacePartialMessageOrBuilder
-
getRepeatedFieldCount
public int getRepeatedFieldCount(Descriptors.FieldDescriptor field)
Deprecated.Description copied from interface:MessageOrBuilderGets the number of elements of a repeated field. This is exactly equivalent to calling the generated "Count" accessor method corresponding to the field.- Specified by:
getRepeatedFieldCountin interfaceMessageOrBuilder
-
getRepeatedField
public java.lang.Object getRepeatedField(Descriptors.FieldDescriptor field, int index)
Deprecated.Description copied from interface:MessageOrBuilderGets an element of a repeated field. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned.- Specified by:
getRepeatedFieldin interfaceMessageOrBuilder
-
getUnknownFields
public UnknownFieldSet getUnknownFields()
Deprecated.Description copied from interface:MessageOrBuilderGet theUnknownFieldSetfor this message.- Specified by:
getUnknownFieldsin interfaceMessageOrBuilder
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
getMessage
public Message getMessage()
Deprecated.Description copied from interface:PartialMessageOrBuilderReturn original message.- Specified by:
getMessagein interfacePartialMessageOrBuilder
-
getFieldMask
public FieldMask getFieldMask()
Deprecated.- Specified by:
getFieldMaskin interfacePartialMessageOrBuilder
-
-