You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
688 B
Java
28 lines
688 B
Java
3 years ago
|
package com.github.jreddit.request.action.mark;
|
||
|
|
||
|
import com.github.jreddit.request.action.MarkActionRequest;
|
||
|
|
||
|
|
||
|
public class VoteRequest extends MarkActionRequest {
|
||
|
|
||
|
/** Endpoint format. */
|
||
|
private static final String ENDPOINT_FORMAT = "/api/vote.json?";
|
||
|
|
||
|
/**
|
||
|
* Vote request constructor.
|
||
|
*
|
||
|
* @param fullname Fullname of what to vote on
|
||
|
* @param direction Direction (must be -1, 0, or 1)
|
||
|
*/
|
||
|
public VoteRequest(String fullname, int direction) {
|
||
|
super(fullname);
|
||
|
this.addBodyParameter("dir", String.valueOf(direction));
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String generateRedditURI() {
|
||
|
return ENDPOINT_FORMAT;
|
||
|
}
|
||
|
|
||
|
}
|