com.dke.data.agrirouter.api.service.parameters.MessageQueryParameters.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agrirouter-api-java-api Show documentation
Show all versions of agrirouter-api-java-api Show documentation
This project contains the API for the communication with the agrirouter. Everything you need for the onboarding process, secure communication and much more.
package com.dke.data.agrirouter.api.service.parameters
import com.dke.data.agrirouter.api.dto.onboard.OnboardingResponse
import com.dke.data.agrirouter.api.exception.IllegalParameterDefinitionException
import com.dke.data.agrirouter.api.service.ParameterValidation
import com.dke.data.agrirouter.api.service.parameters.base.AbstractParameterBase
import lombok.ToString
import javax.validation.constraints.NotNull
/**
* Parameters class. Encapsulation for the services.
*/
@ToString
class MessageQueryParameters : AbstractParameterBase(), ParameterValidation {
@NotNull
lateinit var onboardingResponse: OnboardingResponse
var messageIds: List? = null
var senderIds: List? = null
var sentFromInSeconds: Long? = null
var sentToInSeconds: Long? = null
override fun validate() {
super.validate()
if (null == messageIds && null == senderIds && null == sentFromInSeconds && null == sentToInSeconds) {
throw IllegalParameterDefinitionException("There has to be a filter criteria for the query.")
}
}
}