identifyReferenceType static method
ReferenceType?
identifyReferenceType(
- dynamic book, [
- dynamic startChapter,
- dynamic startVerse,
- dynamic endChapter,
- dynamic endVerse,
Returns the ReferenceType based on the number of passed in arguments.
Implementation
static ReferenceType? identifyReferenceType(book,
[startChapter, startVerse, endChapter, endVerse]) {
if (startChapter == null && endChapter == null) {
return ReferenceType.BOOK;
} else if (startChapter != null &&
endChapter != null &&
startChapter != endChapter) {
return ReferenceType.CHAPTER_RANGE;
} else if (startChapter != null &&
(endChapter == null || endChapter == startChapter) &&
startVerse == null &&
endVerse == null) {
return ReferenceType.CHAPTER;
} else if (startVerse != null && endVerse != null) {
return ReferenceType.VERSE_RANGE;
} else if (startVerse != null) {
return ReferenceType.VERSE;
}
return null;
}