net.continuumsecurity.proxy.model.User Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atf-toolbox Show documentation
Show all versions of atf-toolbox Show documentation
Automation Testing Framework Toolbox Provides simple automation.
The newest version!
package net.continuumsecurity.proxy.model;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.zaproxy.clientapi.core.ApiResponseSet;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class User {
String id;
boolean enabled;
String contextId;
String name;
Map credentials;
public User(ApiResponseSet apiResponseSet) throws IOException {
id = apiResponseSet.getStringValue("id");
enabled = Boolean.valueOf(apiResponseSet.getStringValue("enabled"));
contextId = apiResponseSet.getStringValue("contextId");
name = apiResponseSet.getStringValue("name");
ObjectMapper mapper = new ObjectMapper();
credentials = mapper.readValue(apiResponseSet.getStringValue("credentials"), new TypeReference>(){});
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getContextId() {
return contextId;
}
public void setContextId(String contextId) {
this.contextId = contextId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map getCredentials() {
return credentials;
}
public void setCredentials(Map credentials) {
this.credentials = credentials;
}
}