Package com.twelfthmile.yuga
Class Yuga
java.lang.Object
com.twelfthmile.yuga.Yuga
public class Yuga
extends java.lang.Object
Created by johnjoseph on 19/03/17.
-
Constructor Summary
Constructors Constructor Description Yuga() -
Method Summary
Modifier and Type Method Description static Pair<java.lang.Integer,java.lang.String>checkTypes(java.lang.String type, java.lang.String word)static voidinit()static Responseparse(java.lang.String str)Returns Response containing data-type, captured string and index upto which data was readstatic Responseparse(java.lang.String str, java.util.Map<java.lang.String,java.lang.String> config)Returns Response containing data-type, captured string and index upto which data was readstatic Pair<java.lang.Integer,java.util.Date>parseDate(java.lang.String str)Returns Pair of index upto which date was read and the date objectstatic Pair<java.lang.Integer,java.util.Date>parseDate(java.lang.String str, java.util.Map<java.lang.String,java.lang.String> config)Returns Pair of index upto which date was read and the date objectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Yuga
public Yuga()
-
-
Method Details
-
init
public static void init() -
parseDate
Returns Pair of index upto which date was read and the date object- Parameters:
str- date string- Returns:
- A last index for date string, b date object returns null if string is not of valid date format
-
parseDate
public static Pair<java.lang.Integer,java.util.Date> parseDate(java.lang.String str, java.util.Map<java.lang.String,java.lang.String> config)Returns Pair of index upto which date was read and the date object- Parameters:
str- date stringconfig- pass the message date string for defaulting- Returns:
- A last index for date string, b date object returns null if string is not of valid date format
-
parse
public static Response parse(java.lang.String str, java.util.Map<java.lang.String,java.lang.String> config)Returns Response containing data-type, captured string and index upto which data was read- Parameters:
str- string to be parsedconfig- config for parsing (Eg: date-defaulting)- Returns:
- Yuga Response type
-
parse
Returns Response containing data-type, captured string and index upto which data was read- Parameters:
str- string to be parsed- Returns:
- Yuga Response type
-
checkTypes
public static Pair<java.lang.Integer,java.lang.String> checkTypes(java.lang.String type, java.lang.String word)
-