1

In Java you can create a single file and it may contain more than one enum\class, for example something like this:

Filename: Recorder.java

public enum Recorder {
  RECORDER_A, RECORDER_B;
};

enum Feature {
  FEATURE_A, FEATURE_B;
};

I'm able to create the "Recorder" enum using JavaPoet, but I can't figure out how to create the 2nd one... notice - they are not nested!

Thank you for any input :-)

Shvalb
  • 1,835
  • 2
  • 30
  • 60

1 Answers1

0

This is not possible in JavaPoet because it has caused certain problems with certain build tools. Work around by creating separate files for each top-level type.

Jesse Wilson
  • 39,078
  • 8
  • 121
  • 128