/** * Method creates {@link SlotContract} contract from dsl file where contract is described. * @param fileName is path to dsl file with yaml structure of data for contract. * @return created and ready {@link SlotContract} contract. * @throws IOException if something went wrong */ public static SlotContract fromDslFile(String fileName) throws IOException { Yaml yaml = new Yaml(); try (FileReader r = new FileReader(fileName)) { Binder binder = Binder.from(DefaultBiMapper.deserialize((Map) yaml.load(r))); return new SlotContract().initializeWithDsl(binder); } }