Commit 71de277c authored by Michael Ritter's avatar Michael Ritter
Browse files

Basic models for the Compare api controller

parent 34f9c264
package edu.umiacs.ace.rest.models;
/**
* Individual item in a Compare Request
*
* Created by shake on 3/9/17.
*/
public class CompareFile {
private String path;
private String digest;
public String getPath() {
return path;
}
public String getDigest() {
return digest;
}
public CompareFile setPath(String path) {
this.path = path;
return this;
}
public CompareFile setDigest(String digest) {
this.digest = digest;
return this;
}
}
package edu.umiacs.ace.rest.models;
import edu.umiacs.ace.rest.CompareController;
import java.util.List;
/**
* The request body sent to the {@link CompareController}
*
* Created by shake on 3/9/17.
*/
public class CompareRequest {
private List<CompareFile> comparisons;
public List<CompareFile> getComparisons() {
return comparisons;
}
public CompareRequest setComparisons(List<CompareFile> comparisons) {
this.comparisons = comparisons;
return this;
}
}
package edu.umiacs.ace.rest.models;
import edu.umiacs.ace.rest.CompareController;
import java.util.HashSet;
import java.util.Set;
/**
* Response object returned by the {@link CompareController}
*
* Created by shake on 3/9/17.
*/
public class CompareResponse {
private Set<String> diff;
private Set<String> match;
private Set<String> notFound;
public CompareResponse() {
this.diff = new HashSet<>();
this.match = new HashSet<>();
this.notFound = new HashSet<>();
}
public CompareResponse addDiff(String path) {
diff.add(path);
return this;
}
public Set<String> getDiff() {
return diff;
}
public CompareResponse setDiff(Set<String> diff) {
this.diff = diff;
return this;
}
public CompareResponse addMatch(String path) {
match.add(path);
return this;
}
public Set<String> getMatch() {
return match;
}
public CompareResponse setMatch(Set<String> match) {
this.match = match;
return this;
}
public CompareResponse addNotFound(String path) {
notFound.add(path);
return this;
}
public Set<String> getNotFound() {
return notFound;
}
public CompareResponse setNotFound(Set<String> notFound) {
this.notFound = notFound;
return this;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment