parseList static method
Parses o to a list of APIContentEncoding, keeping the order and
ignoring unknown and duplicated entries. Accepts a List or a comma
separated String. Returns null if o is null.
Implementation
static List<APIContentEncoding>? parseList(Object? o) {
if (o == null) return null;
Iterable<Object?> list;
if (o is Iterable) {
list = o;
} else {
list = o.toString().split(',');
}
var encodings = <APIContentEncoding>[];
for (var e in list) {
var encoding = parse(e);
if (encoding != null && !encodings.contains(encoding)) {
encodings.add(encoding);
}
}
return encodings;
}