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

enum generates nullable values #1816

Open
stuartmorgan opened this issue Dec 17, 2024 · 0 comments
Open

enum generates nullable values #1816

stuartmorgan opened this issue Dec 17, 2024 · 0 comments

Comments

@stuartmorgan
Copy link

I have this Java declaration in a class:

  public enum StreamingFormat {
    /** Default, if the format is either not known or not another valid format. */
    UNKNOWN,

    /** Smooth Streaming. */
    SMOOTH,

    /** MPEG-DASH (Dynamic Adaptive over HTTP). */
    DYNAMIC_ADAPTIVE,

    /** HTTP Live Streaming (HLS). */
    HTTP_LIVE
  }

The resulting generated code is a class with getters like:

  static VideoAsset$StreamingFormat? get DYNAMIC_ADAPTIVE =>
      _id_DYNAMIC_ADAPTIVE.get(
          _class, const $VideoAsset$StreamingFormat$NullableType());

I would not expect enum values to be nullable. (It also not clear to me why they are a class in the first place, rather than an enum.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant