Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added descriptor API #57

Merged
merged 5 commits into from
Oct 7, 2023
Merged

Added descriptor API #57

merged 5 commits into from
Oct 7, 2023

Conversation

ennerf
Copy link
Collaborator

@ennerf ennerf commented Sep 21, 2023

Added descriptors for #55. New public API:

class SomeGeneratedMessage extends ProtoMessage {
  public static Descriptor getDescriptor();
} 

interface Descriptor {
  FileDescriptor getFile();
  String getName();
  String getFullName();
  byte[] toProtoBytes();
}

interface FileDescriptor {
  String getName();
  String getFullName();
  String getPackage();
  byte[] toProtoBytes();
  List<FileDescriptor> getDependencies();
  List<Descriptor> getAllContainedTypes(); // everything that is in this file
  List<Descriptor> getAllKnownTypes(); // all types from this file and all dependencies
}

The PR also removes the recently added SomeGeneratedMessage::getDescriptorProtoBytes. The feature was experimental and didn't work as intended.

@PeterJohnson
Copy link

Works great for me!

@ennerf ennerf merged commit ebbfc4c into develop Oct 7, 2023
4 checks passed
@ennerf ennerf deleted the descriptors branch October 7, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants