24 lines
511 B
Java
24 lines
511 B
Java
package eu.eudat.file.transformer.model.rda.mapper;
|
|
|
|
import eu.eudat.file.transformer.model.rda.GrantId;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import java.util.Map;
|
|
|
|
@Component
|
|
public class GrantIdRDAMapper {
|
|
|
|
public GrantId toRDA(String id) {
|
|
if (id == null || id.isBlank()) return null;
|
|
|
|
GrantId rda = new GrantId();
|
|
rda.setIdentifier(id);
|
|
rda.setType(GrantId.Type.OTHER);
|
|
return rda;
|
|
}
|
|
|
|
public String toEntity(GrantId rda) {
|
|
return rda == null ? null : rda.getIdentifier();
|
|
}
|
|
}
|