com.swisscom.cloud.sb.broker.backup.converter.RestoreDtoConverter.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of broker Show documentation
Show all versions of broker Show documentation
Swisscom's Open Service Broker API implementation
package com.swisscom.cloud.sb.broker.backup.converter
import com.swisscom.cloud.sb.broker.backup.RestoreStatusConverter
import com.swisscom.cloud.sb.broker.converter.AbstractGenericConverter
import com.swisscom.cloud.sb.broker.model.Restore
import com.swisscom.cloud.sb.model.backup.RestoreDto
import groovy.transform.CompileStatic
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
@CompileStatic
@Component
class RestoreDtoConverter extends AbstractGenericConverter {
private RestoreStatusConverter restoreStatusConverter
@Autowired
RestoreDtoConverter(RestoreStatusConverter restoreStatusConverter) {
this.restoreStatusConverter = restoreStatusConverter
}
@Override
public void convert(Restore source, RestoreDto prototype) {
prototype.id = source.guid
prototype.backup_id = source.backup.guid
prototype.created_at = source.dateRequested
prototype.updated_at = source.dateUpdated
prototype.status = restoreStatusConverter.convert(source.status)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy