I'm getting a compiler error that I don't understand. The code below produces the following error:
error: type mismatch; found : oldEntity.type (with underlying type com.mycompany.address.AddressEntity) required: $1 this.esDocsForAddressEntity.filter(.shouldTriggerRefresh(oldEntity, newEntity)).map(_.esDocName)
object AddressToEsDocMapper {
private val esDocsForAddressEntity = List[EsDocRefreshTrigger[_]](new PartyAddressRefreshTrigger())
def findEsDocsForUpdate(oldEntity : AddressEntity, newEntity : AddressEntity) : List[String] = {
this.esDocsForAddressEntity.filter(_.shouldTriggerRefresh(oldEntity, newEntity)).map(_.esDocName)
}
private class PartyAddressRefreshTrigger extends EsDocRefreshTrigger[AddressEntity] {
val esDocName = "PartyAddress"
override def shouldTriggerRefresh(oldEntity : AddressEntity, newEntity : AddressEntity) : Boolean = {
oldEntity.addressLine2 != newEntity.addressLine2 ||
oldEntity.addressLine3 != newEntity.addressLine3 ||
oldEntity.addressLine1 != newEntity.addressLine1
}
}
}