Class Date
java.lang.Object
com.microblink.blinkcard.results.date.Date
- All Implemented Interfaces:
android.os.Parcelable,SimpleDateResult
Helper class for obtaining date results.
-
Nested Class Summary
-
Field Summary
FieldsFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Method Summary
Modifier and TypeMethodDescriptionstatic DatecreateFromDMY(int day, int month, int year, String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDatefrom native object.static DatecreateUnparsed(String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDatefrom native object, when date has not been successfully parsed from the givenoriginalDateString.intgetDate()Date getter, ifSimpleDaterepresentation of date result exists returns it, otherwise returns null.Returns original string representation of the date which has been extracted from the OCR result.booleanIndicates that date does not appear on the document but is filled by our internal domain knowledge.toString()voidwriteToParcel(android.os.Parcel parcel, int i)
-
Field Details
-
CREATOR
-
-
Method Details
-
getOriginalDateString
Returns original string representation of the date which has been extracted from the OCR result. If it is successfully parsed toSimpleDateobject, it can be obtained by usinggetDate()method.- Returns:
- original string representation of the date which has been extracted from the OCR result
-
isFilledByDomainKnowledge
public boolean isFilledByDomainKnowledge()Indicates that date does not appear on the document but is filled by our internal domain knowledge.- Returns:
- true if the date is filled by our internal domain knowledge
-
getDate
Date getter, ifSimpleDaterepresentation of date result exists returns it, otherwise returns null. To obtain original date string usegetOriginalDateString()method.- Specified by:
getDatein interfaceSimpleDateResult- Returns:
- if
SimpleDaterepresentation of date result exists returns it, otherwise returns null.
-
createFromDMY
@NonNull public static Date createFromDMY(int day, int month, int year, @NonNull String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDatefrom native object.- Parameters:
day- day of the monthmonth- month of the year from interval [1,12]year- full yearoriginalDateString- original string from which native object has been parsed- Returns:
Dateobject
-
createUnparsed
@NonNull public static Date createUnparsed(@NonNull String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDatefrom native object, when date has not been successfully parsed from the givenoriginalDateString.- Parameters:
originalDateString- original string from which native object has been created and which has not been successfully parsed to date.- Returns:
Dateobject
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel parcel, int i) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
toString
-