Как обернуть java-перечисление в delphi? - PullRequest
0 голосов
/ 28 ноября 2018

У меня есть этот класс в Java:

public class SessionDescription {

  public static enum Type {
    OFFER,
    PRANSWER,
    ANSWER;

    public String canonicalForm() {
      return name().toLowerCase(Locale.US);
    }

    @CalledByNative("Type")
    public static Type fromCanonicalForm(String canonical) {
      return Type.valueOf(Type.class, canonical.toUpperCase(Locale.US));
    }
  }

  public final Type type;
  public final String description;

  @CalledByNative
  public SessionDescription(Type type, String description) {
    this.type = type;
    this.description = description;
  }

  @CalledByNative
  String getDescription() {
    return description;
  }

  @CalledByNative
  String getTypeInCanonicalForm() {
    return type.canonicalForm();
  }
}

Как мне определить интерфейс для Type (public static enum Type {...}) в Delphi?

...