mapstruct: map string parameter to a field

27 views Asked by At

I'm trying to map a single String parameter to a field on target type:

@Mapper(uses = ReferenceUniqueIdentifierMapper.class)
public interface NestedReferenceMapper {
    @Mapping(source = "referenceId", target = "referenceUniqueIdentifier")
    public NestedReference toDomainModel(String referenceId);
}

My target class is:

public class NestedReference {

    private final ReferenceUniqueIdentifier referenceUniqueIdentifier;

}

I'm getting:

No property named "referenceId" exists in source parameter(s). Did you mean "bytes"? Occured at 'NestedReference toDomainModel(String arg0)' in 'NestedReferenceMapper'.

Why it's telling me that refereceId doesn't exist if there's a defined String referenceId method parameter defined?

Any ideas?

0

There are 0 answers