@ThreadSafe public final class DraftPair extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
(package private) static class |
DraftPair.MalformedContent
Thrown when a request cannot be met because the content of a page is not in the
required form.
|
(package private) static class |
DraftPair.MalformedSpecifier
Thrown when a request cannot be met because the specifier of a draft pair is not
in the required form.
|
(package private) static class |
DraftPair.PathMismatch
Thrown when a request cannot be met because an actual draft revision path is
inconsistent with the expected path.
|
(package private) static class |
DraftPair.RevisionSeriesMismatch
Thrown when a request cannot be met because the revision series of the difference
key no longer matches that of the pollwiki.
|
Modifier and Type | Method and Description |
---|---|
CoreRevision |
aCore()
The core revision of the a-draft.
|
String |
aUserMnemonic()
A short abbreviation of the username of the first draft's author.
|
CoreRevision |
bCore()
The core revision of the b-draft.
|
String |
bUserMnemonic()
A short abbreviation of the username of the second draft's author.
|
DiffKeyParse |
diffKeyParse()
The difference key of this draft pair.
|
static DraftPair |
newDraftPair(DiffKeyParse diffKeyParse,
PollwikiVS wiki)
Constructs a DraftPair from a parsed difference key.
|
static DraftPair |
newDraftPair(String pageName1,
String pageName2,
VoteServer.Run vsRun,
CountSource countSource)
Constructs a DraftPair from the latest revisions of the specified position cores.
|
static List<Throwable> |
newDraftPairs(ArrayList<String> aPageNameList,
String bPageName,
VoteServer.Run vsRun,
CountSource countSource,
List<DraftPair> pairs,
List<Throwable> userXList)
Constructs a DraftPair for the latest of each of the specified position cores that
resolves to a draft (aPageNameList) and appends it to the provided list of pairs.
|
DraftPair |
newReversePair()
Constructs the reverse of this draft pair, in which all components of a-draft and
b-draft are interchanged.
|
public static DraftPair newDraftPair(DiffKeyParse diffKeyParse, PollwikiVS wiki) throws IOException
IOException
diffKeyParse()
public static DraftPair newDraftPair(String pageName1, String pageName2, VoteServer.Run vsRun, CountSource countSource) throws IOException
countSource
- for possible use during this call, or null to construct one
internally.IOException
public static List<Throwable> newDraftPairs(ArrayList<String> aPageNameList, String bPageName, VoteServer.Run vsRun, CountSource countSource, List<DraftPair> pairs, List<Throwable> userXList) throws IOException
aPageNameList
- the name list of first (a) core pages, ideally with spare
capacity to append one additional name. Duplicate names will not result in
duplicate pairs because the MediaWiki API collapses them to one.countSource
- for possible use during this call, or null to construct one
internally.userXList
- a pre-constructed list to which any user actionable
exceptions are to be appended, or null if none was pre-constructed.IOException
public CoreRevision aCore()
public String aUserMnemonic()
public CoreRevision bCore()
public String bUserMnemonic()
public DiffKeyParse diffKeyParse()
public DraftPair newReversePair()