Package com.microblink.results.date
Class DateResult
- java.lang.Object
-
- com.microblink.results.date.DateResult
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<DateResult>
CREATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DateResult
createFromDMY(int day, int month, int year, java.lang.String originalDateString)
This method is called from native code to buildDateResult
from native object.static DateResult
createUnparsed(java.lang.String originalDateString)
This method is called from native code to buildDateResult
from native object, when date has not been successfully parsed from the givenoriginalDateString
.int
describeContents()
Date
getDate()
Date getter, ifDate
representation of date result exists returns it, otherwise returns null.java.lang.Object
getNativeResult()
Returns the native java object containing the result.java.lang.String
getOriginalDateString()
Returns original string representation of the date which has been extracted from the OCR result.java.lang.String
getStringResult()
Returns the string version of the result.java.lang.String
toString()
void
writeToParcel(android.os.Parcel parcel, int i)
-
-
-
Field Detail
-
CREATOR
@NonNull public static final android.os.Parcelable.Creator<DateResult> CREATOR
-
-
Method Detail
-
getOriginalDateString
@NonNull public java.lang.String getOriginalDateString()
Returns original string representation of the date which has been extracted from the OCR result. If it is successfully parsed toDate
object, it can be obtained by usinggetDate()
method.- Returns:
- original string representation of the date which has been extracted from the OCR result
-
getDate
@Nullable public Date getDate()
Date getter, ifDate
representation of date result exists returns it, otherwise returns null. To obtain original date string usegetOriginalDateString()
method.- Returns:
- if
Date
representation of date result exists returns it, otherwise returns null.
-
createFromDMY
@NonNull public static DateResult createFromDMY(int day, int month, int year, @NonNull java.lang.String originalDateString)
This method is called from native code to buildDateResult
from 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:
DateResult
object
-
createUnparsed
@NonNull public static DateResult createUnparsed(@NonNull java.lang.String originalDateString)
This method is called from native code to buildDateResult
from 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:
DateResult
object
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel parcel, int i)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
getNativeResult
@Nullable public java.lang.Object getNativeResult()
Description copied from interface:Result
Returns the native java object containing the result. For example, forDateResult
, this method will returnDate
object.- Specified by:
getNativeResult
in interfaceResult
- Returns:
- the native java object containing the result.
-
getStringResult
@Nullable public java.lang.String getStringResult()
Description copied from interface:Result
Returns the string version of the result. For example, forDateResult
, this method will return original string from which date was parsed (same asgetOriginalDateString()
.- Specified by:
getStringResult
in interfaceResult
- Returns:
- string version of the result
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-