io.electrum.vas.model.BasicRequest Maven / Gradle / Ivy
package io.electrum.vas.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.electrum.vas.Utils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
import javax.validation.constraints.NotNull;
import java.util.Objects;
import java.util.UUID;
/**
* The data required in all value added service requests
**/
@ApiModel(description = "The data required in all value added service requests")
public class BasicRequest {
protected UUID id = null;
protected DateTime time = null;
protected Sender sender = null;
/**
* The randomly generated UUID identifying this transaction, as defined for a variant 4 UUID in [RFC
* 4122](https://tools.ietf.org/html/rfc4122)
**/
public BasicRequest id(UUID id) {
this.id = id;
return this;
}
@ApiModelProperty(required = true, value = "The randomly generated UUID identifying this transaction, as defined for a variant 4 UUID in [RFC 4122](https://tools.ietf.org/html/rfc4122)")
@JsonProperty("id")
@NotNull
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
/**
* The date and time of the request in UTC, as recorded by the sender. The format shall be as defined for date-time
* in [RFC 3339 section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). It is recommended that the optional
* time-secfrac be included up to millisecond precision
**/
public BasicRequest time(DateTime time) {
this.time = time;
return this;
}
@ApiModelProperty(required = true, value = "The date and time of the request as recorded by the sender. The format shall be as defined for date-time in [RFC 3339 section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). It is recommended that the optional time-secfrac be included up to millisecond precision")
@JsonProperty("time")
@NotNull
public DateTime getTime() {
return time;
}
public void setTime(DateTime time) {
this.time = time;
}
/**
* Data relating to the originator of the transaction
**/
public BasicRequest sender(Sender sender) {
this.sender = sender;
return this;
}
@ApiModelProperty(required = true, value = "Data relating to the originator of the transaction")
@JsonProperty("sender")
@NotNull
public Sender getSender() {
return sender;
}
public void setSender(Sender sender) {
this.sender = sender;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BasicRequest vasRequest = (BasicRequest) o;
return Objects.equals(id, vasRequest.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BasicRequest {\n");
sb.append(" id: ").append(Utils.toIndentedString(id)).append("\n");
sb.append(" time: ").append(Utils.toIndentedString(time)).append("\n");
sb.append(" sender: ").append(Utils.toIndentedString(sender)).append("\n");
sb.append("}");
return sb.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy