Scala, Design Patterns, Programming, Factory Pattern.
to be changed. In the apply method the end of the string it’s used to check the type of the document which it’s intended to be readed and based on the type of document a csvReader, jsonReader or parquetReader it’s used. If the file doesn’t correspond to any of the expected files a RuntimeException