Class ProtoMessageTypeProvider.Builder

    • Method Detail

      • addFileDescriptors

        @CanIgnoreReturnValue
        public ProtoMessageTypeProvider.Builder addFileDescriptors​(com.google.protobuf.Descriptors.FileDescriptor... fileDescriptors)
        Adds a Descriptors.FileDescriptor to the provider.
      • addFileDescriptors

        @CanIgnoreReturnValue
        public ProtoMessageTypeProvider.Builder addFileDescriptors​(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors)
        Adds a collection of Descriptors.FileDescriptors to the provider.
      • addDescriptors

        @CanIgnoreReturnValue
        public ProtoMessageTypeProvider.Builder addDescriptors​(java.lang.Iterable<com.google.protobuf.Descriptors.Descriptor> descriptors)
        Adds a collection of Descriptors.Descriptors. The parent file of each descriptor is added.
      • setAllowJsonFieldNames

        @CanIgnoreReturnValue
        public ProtoMessageTypeProvider.Builder setAllowJsonFieldNames​(boolean allowJsonFieldNames)
        Use the `json_name` field option on a protobuf message as the name of the field.

        If enabled, the type checker will only accept the `json_name` and will no longer recognize the original protobuf field name. This is to avoid ambiguity between the two names.

      • setResolveTypeDependencies

        @CanIgnoreReturnValue
        public ProtoMessageTypeProvider.Builder setResolveTypeDependencies​(boolean resolveTypeDependencies)
        If true, all transitive dependencies of the added Descriptors.FileDescriptors will be resolved and their types will be made available to the type provider. By default, this is disabled.