Interface ContractConverter<T>

Type Parameters:
T - - type to which we want to convert the contract
All Superinterfaces:
ContractReader<T>, ContractStorer<T>

public interface ContractConverter<T> extends ContractStorer<T>, ContractReader<T>
Converter to be used to convert FROM File TO Contract and from Contract to T.
Since:
1.1.0
Author:
Marcin Grzejszczak
  • Method Details

    • isAccepted

      boolean isAccepted(File file)
      Should this file be accepted by the converter. Can use the file extension to check if the conversion is possible.
      Parameters:
      file - - file to be considered for conversion
      Returns:
      - true if the given implementation can convert the file
    • convertFrom

      Collection<Contract> convertFrom(File file)
      Converts the given File to its Contract representation.
      Parameters:
      file - - file to convert
      Returns:
      - Contract representation of the file
    • convertTo

      T convertTo(Collection<Contract> contract)
      Converts the given Contract to a ContractConverter representation.
      Parameters:
      contract - - the parsed contract
      Returns:
      - ContractConverter the type to which we do the conversion