mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-06 19:35:51 +02:00
Makes BaseMapper and CollectionToDtoMapper available for plugins
This commit is contained in:
@@ -5,12 +5,12 @@ import org.mapstruct.Mapping;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
abstract class BaseMapper<T, D extends HalRepresentation> {
|
||||
public abstract class BaseMapper<T, D extends HalRepresentation> {
|
||||
|
||||
@Mapping(target = "attributes", ignore = true) // We do not map HAL attributes
|
||||
public abstract D map(T modelObject);
|
||||
|
||||
Instant mapTime(Long epochMilli) {
|
||||
protected Instant mapTime(Long epochMilli) {
|
||||
return epochMilli == null? null: Instant.ofEpochMilli(epochMilli);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.stream.Collectors;
|
||||
import static de.otto.edison.hal.Embedded.embeddedBuilder;
|
||||
import static de.otto.edison.hal.Links.linkingTo;
|
||||
|
||||
abstract class CollectionToDtoMapper<E, D extends HalRepresentation> {
|
||||
public abstract class CollectionToDtoMapper<E, D extends HalRepresentation> {
|
||||
|
||||
private final String collectionName;
|
||||
private final BaseMapper<E, D> mapper;
|
||||
|
||||
Reference in New Issue
Block a user