class InstrumentAccountCodeMapper {

    public InstrumentAccountCode toDomain(InstrumentAccountCodeContract contract) {

        InstrumentAccountCode instrumentAccountCode = new InstrumentAccountCode();

        instrumentAccountCode.setId(contract.getId());

        if (contract.getInstrumentType() != null)
            instrumentAccountCode.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType()));

        if (contract.getAccountCode() != null)
            instrumentAccountCode.setAccountCode(contract.getAccountCode());

        instrumentAccountCode.setCreatedBy(contract.getCreatedBy());
        instrumentAccountCode.setCreatedDate(contract.getCreatedDate());
        instrumentAccountCode.setLastModifiedBy(contract.getLastModifiedBy());
        instrumentAccountCode.setLastModifiedDate(contract.getLastModifiedDate());
        instrumentAccountCode.setTenantId(contract.getTenantId());

        return instrumentAccountCode;
    }

}