Makes BaseMapper and CollectionToDtoMapper available for plugins

This commit is contained in:
Johannes Schnatterer
2018-08-02 18:33:36 +02:00
parent 1c52b33229
commit 7107d14bce
2 changed files with 3 additions and 3 deletions

View File

@@ -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);
}
}

View File

@@ -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;