com.testdroid.api.model.APIActivity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testdroid-api Show documentation
Show all versions of testdroid-api Show documentation
The Testdroid API library for Java
package com.testdroid.api.model;
import com.testdroid.api.APIEntity;
import com.testdroid.api.util.TimeConverter;
import jakarta.xml.bind.annotation.XmlType;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @author Michał Szpruta
*/
public class APIActivity extends APIEntity {
@XmlType(namespace = "APIActivity")
public enum HttpMethod {
GET,
HEAD,
POST,
PUT,
PATCH,
DELETE,
OPTIONS,
TRACE
}
private Date createTime;
private HttpMethod httpMethod;
private String userAgent;
private String parameters;
private String uri;
private String userEmail;
private Long userId;
private String body;
private String accept;
private boolean deprecatedResource;
public APIActivity() {
}
@SuppressWarnings("squid:S107")
public APIActivity(
Long id, LocalDateTime createTime, HttpMethod httpMethod, String userAgent, String parameters, String uri,
String body, String accept, Long userId, String userEmail, boolean deprecatedResource) {
super(id);
this.createTime = TimeConverter.toDate(createTime);
this.httpMethod = httpMethod;
this.userAgent = userAgent;
this.parameters = parameters;
this.uri = uri;
this.body = body;
this.accept = accept;
this.userId = userId;
this.userEmail = userEmail;
this.deprecatedResource = deprecatedResource;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public HttpMethod getHttpMethod() {
return httpMethod;
}
public void setHttpMethod(HttpMethod httpMethod) {
this.httpMethod = httpMethod;
}
public String getParameters() {
return parameters;
}
public void setParameters(String parameters) {
this.parameters = parameters;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserEmail() {
return userEmail;
}
public void setUserEmail(String userEmail) {
this.userEmail = userEmail;
}
public String getUserAgent() {
return userAgent;
}
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getAccept() {
return accept;
}
public void setAccept(String accept) {
this.accept = accept;
}
public boolean isDeprecatedResource() {
return deprecatedResource;
}
public void setDeprecatedResource(boolean deprecatedResource) {
this.deprecatedResource = deprecatedResource;
}
@Override
protected void clone(T from) {
APIActivity apiActivity = (APIActivity) from;
cloneBase(from);
this.createTime = apiActivity.createTime;
this.httpMethod = apiActivity.httpMethod;
this.userAgent = apiActivity.userAgent;
this.parameters = apiActivity.parameters;
this.uri = apiActivity.uri;
this.userId = apiActivity.userId;
this.userEmail = apiActivity.userEmail;
this.body = apiActivity.body;
this.accept = apiActivity.accept;
this.deprecatedResource = apiActivity.deprecatedResource;
}
}