我在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();
}
}
如何在Delphi中为Type
(public static enum Type {...}
)定义接口?