Package dev.cel.common.internal
Class DefaultInstanceMessageFactory
- java.lang.Object
-
- dev.cel.common.internal.DefaultInstanceMessageFactory
-
@Internal public final class DefaultInstanceMessageFactory extends java.lang.ObjectSingleton factory for creating default messages from a protobuf descriptor.CEL Library Internals. Do Not Use.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultInstanceMessageFactorygetInstance()Gets a single instance of this MessageFactoryjava.util.Optional<com.google.protobuf.Message>getPrototype(com.google.protobuf.Descriptors.Descriptor descriptor)Creates a default instance of a protobuf message given a descriptor.
-
-
-
Method Detail
-
getInstance
public static DefaultInstanceMessageFactory getInstance()
Gets a single instance of this MessageFactory
-
getPrototype
public java.util.Optional<com.google.protobuf.Message> getPrototype(com.google.protobuf.Descriptors.Descriptor descriptor)
Creates a default instance of a protobuf message given a descriptor. This is essentially the same as calling FooMessage.getDefaultInstance(), except reflection is leveraged.- Returns:
- Default instance of a type. Returns an empty optional if the descriptor used to construct the type via reflection is different to the provided descriptor or if the descriptor class isn't loaded in the binary.
-
-