SetToCollectionGenericConverter constructor

SetToCollectionGenericConverter(
  1. ConversionService cs
)

A converter that transforms a Set to a specific collection subtype.

Supported conversions:

  • SetSet
  • SetList
  • SetQueue
  • SetIterable
  • SetArrayList
  • SetHashSet
  • SetLinkedQueue
  • SetLinkedList
  • SetLinkedStack
  • SetStack
  • Setcol.LinkedHashSet
  • Setcol.ListBase
  • Setcol.SetBase
  • Setcol.Queue

Example:

final converter = SetToCollectionConverter();
print(converter.convert({1, 2, 3}, Class.forType(Set), Class<List>(null, PackageNames.DART))); // prints: [1, 2, 3]

Implementation

SetToCollectionGenericConverter(ConversionService cs) : super(cs, Class<Set>(null, PackageNames.DART));