mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
Create CollectionToDtoMapper in core module.
See commit 689e5ae95645768b024dee52c10451c944a41527. Useful for hg plugin.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import de.otto.edison.hal.HalRepresentation;
|
||||
import org.mapstruct.Mapping;
|
||||
import sonia.scm.ModelObject;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
abstract class BaseMapper<T extends ModelObject, D extends HalRepresentation> {
|
||||
|
||||
@Mapping(target = "attributes", ignore = true) // We do not map HAL attributes
|
||||
public abstract D map(T modelObject);
|
||||
|
||||
Instant mapTime(Long epochMilli) {
|
||||
return epochMilli == null? null: Instant.ofEpochMilli(epochMilli);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user