class InstrumentAccountCodeMapper {

    public InstrumentAccountCodeContract toContract(InstrumentAccountCode instrumentAccountCode) {

        InstrumentAccountCodeContract contract = new InstrumentAccountCodeContract();

        contract.setId(instrumentAccountCode.getId());

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

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

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

        return contract;
    }

}