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 void init()  
    static Response parse​(java.lang.String str)
    Returns Response containing data-type, captured string and index upto which data was read
    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
    static Pair<java.lang.Integer,​java.util.Date> parseDate​(java.lang.String str)
    Returns Pair of index upto which date was read and the date object
    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

    Methods 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

      public static Pair<java.lang.Integer,​java.util.Date> parseDate​(java.lang.String str)
      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 string
      config - 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 parsed
      config - config for parsing (Eg: date-defaulting)
      Returns:
      Yuga Response type
    • parse

      public static Response parse​(java.lang.String str)
      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)