class AttachmentHandler implements AttachmentService.Iface {

    @Override
    public List<AttachmentUsage> getUsedAttachments(Source usedBy, UsageData filter) throws TException {
        assertNotNull(usedBy);
        assertTrue(usedBy.isSet());

        if (filter != null && filter.isSet()) {
            return attachmentUsageRepository.getUsedAttachments(usedBy.getFieldValue().toString(), filter.getSetField().toString());
        } else {
            return attachmentUsageRepository.getUsedAttachments(usedBy.getFieldValue().toString());
        }
    }

    public  AttachmentHandler();

}