psdi.iface.mos

Class ConversionUtil

  • java.lang.Object
    • psdi.iface.mos.ConversionUtil


  • public class ConversionUtil
    extends java.lang.Object
    Utility class for all conversions
    • Constructor Summary

      Constructors 
      Constructor and Description
      ConversionUtil() 
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      static java.lang.String booleanToString(boolean data)
      Converts boolean to string.
      static java.lang.String dateToString(java.util.Date in)
      This method will convert java.util.Date to ISO 8601 dateTime format string
      static java.lang.String doubleToString(double in)
      Converts double to string.
      static void evaluateDelta(java.util.Calendar cal, java.lang.String delta) 
      static java.lang.String getMboValue(java.lang.String name, MboRemote mbo, int maxType)
      Get value from XML and convert it to String.
      static java.lang.Object getMboValueAsObject(java.lang.String name, MboRemote mbo, int maxType)
      Get value from Mbo as object.
      static java.lang.String getMboValueAsXMLValue(java.lang.String mboAttrName, MboRemote mbo, int maxType)
      Get value from XML and convert it to String.
      static java.util.Date getSysDay() 
      static java.lang.String getValueAsLocalazedString(java.lang.String value, int maxType, java.util.Locale locale)
      Get value from XML and convert it to String.
      static java.lang.Object getValueAsObject(java.lang.String value, int maxType)
      Get value from XML and convert it to String.
      static java.lang.String getXMLValue(java.lang.String name, StructureObject strucObject, int maxType)
      Get value from XML and convert it to String.
      static java.lang.String intToString(int in)
      Converts int to string.
      static boolean isMaxTypeBlob(int maxType)
      This method will detrmine in MaxType is a Blob format
      static boolean isMaxTypeCrypto(int maxType)
      This method will detrmine in MaxType is a Crypto format
      static boolean isMaxTypeDate(int maxType)
      This method will detrmine in MaxType is a date format
      static boolean isMaxTypeDouble(int maxType)
      This method will detrmine in MaxType is a double format
      static boolean isMaxTypeLong(int maxType)
      This method will detrmine in MaxType is a long format
      static boolean isMaxTypeString(int maxType)
      This method will detrmine in MaxType is a date format
      static java.lang.String longToString(long in)
      Converts long to string.
      static void setValueAsObject(java.lang.String attributeName, StructureObject str, java.lang.String value, int maxType)
      Get value from XML and convert it to String.
      static boolean stringToBoolean(java.lang.String data)
      This method will convert String to boolean
      static java.util.Date stringToDate(java.lang.String data)
      This method will convert String in format acceptable by JMIG to java.util.Date
      static double stringToDouble(java.lang.String data)
      This method will convert String to double
      static java.lang.String stringToGL(java.util.List data)
      Deprecated.  
      static java.lang.String stringToGL(java.util.List data, java.lang.String orgId)
      This method will convert String to GL account
      static int stringToInt(java.lang.String data)
      This method will convert String to int
      static long stringToLong(java.lang.String data)
      This method will convert String to long
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConversionUtil

        public ConversionUtil()
    • Method Detail

      • stringToDate

        public static java.util.Date stringToDate(java.lang.String data)
                                           throws MXException
        This method will convert String in format acceptable by JMIG to java.util.Date
        Parameters:
        data - Give date in String format
        Returns:
        String representation of field
        Throws:
        MXException - Maximo exception
      • getSysDay

        public static java.util.Date getSysDay()
                                        throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
      • evaluateDelta

        public static void evaluateDelta(java.util.Calendar cal,
                                         java.lang.String delta)
      • stringToDouble

        public static double stringToDouble(java.lang.String data)
                                     throws MXException
        This method will convert String to double
        Parameters:
        data - Give String representataion of the data
        Returns:
        double representation of the data
        Throws:
        MXException
      • stringToInt

        public static int stringToInt(java.lang.String data)
                               throws MXException
        This method will convert String to int
        Parameters:
        data - Give String representataion of the data
        Returns:
        int representation of the data
        Throws:
        MXException
      • stringToLong

        public static long stringToLong(java.lang.String data)
                                 throws MXException
        This method will convert String to long
        Parameters:
        data - Give String representataion of the data
        Returns:
        long representation of the data
        Throws:
        MXException
      • stringToBoolean

        public static boolean stringToBoolean(java.lang.String data)
                                       throws MXException
        This method will convert String to boolean
        Parameters:
        data - Give String representataion of the data
        Returns:
        boolean representation of the data
        Throws:
        MXException
      • stringToGL

        public static java.lang.String stringToGL(java.util.List data)
                                           throws MXException
        Deprecated. 
        This method will convert String to GL account
        Parameters:
        data - Give list of GL components
        Returns:
        GL representation of the data
        Throws:
        MXException - Maximo Application exception
      • stringToGL

        public static java.lang.String stringToGL(java.util.List data,
                                                  java.lang.String orgId)
                                           throws MXException
        This method will convert String to GL account
        Parameters:
        data - Give list of GL components
        orgId - Organization
        Returns:
        GL representation of the data
        Throws:
        MXException - Maximo Application exception
      • booleanToString

        public static java.lang.String booleanToString(boolean data)
                                                throws MXException
        Converts boolean to string.
        Parameters:
        data - input boolean
        Returns:
        string value
        Throws:
        MXException - - MAXIMO exception
      • dateToString

        public static java.lang.String dateToString(java.util.Date in)
        This method will convert java.util.Date to ISO 8601 dateTime format string
        Parameters:
        in - Give date in java.util.Date format
        Returns:
        dateTime String
      • doubleToString

        public static java.lang.String doubleToString(double in)
        Converts double to string.
        Parameters:
        in - input double
        Returns:
        string value
      • intToString

        public static java.lang.String intToString(int in)
        Converts int to string.
        Parameters:
        in - input integer
        Returns:
        string value
      • longToString

        public static java.lang.String longToString(long in)
        Converts long to string.
        Parameters:
        in - input long
        Returns:
        string value
      • isMaxTypeDate

        public static boolean isMaxTypeDate(int maxType)
        This method will detrmine in MaxType is a date format
        Parameters:
        maxType - Give MaxType as Integer
        Returns:
        true or false
      • isMaxTypeString

        public static boolean isMaxTypeString(int maxType)
        This method will detrmine in MaxType is a date format
        Parameters:
        maxType - Give MaxType as Integer
        Returns:
        true or false
      • isMaxTypeLong

        public static boolean isMaxTypeLong(int maxType)
        This method will detrmine in MaxType is a long format
        Parameters:
        maxType - Give MaxType as Integer
        Returns:
        true or false
      • isMaxTypeDouble

        public static boolean isMaxTypeDouble(int maxType)
        This method will detrmine in MaxType is a double format
        Parameters:
        maxType - Give MaxType as Integer
        Returns:
        true or false
      • isMaxTypeBlob

        public static boolean isMaxTypeBlob(int maxType)
        This method will detrmine in MaxType is a Blob format
        Parameters:
        maxType - Give MaxType as Integer
        Returns:
        true or false
      • isMaxTypeCrypto

        public static boolean isMaxTypeCrypto(int maxType)
        This method will detrmine in MaxType is a Crypto format
        Parameters:
        maxType - Give MaxType as Integer
        Returns:
        true or false
      • getXMLValue

        public static java.lang.String getXMLValue(java.lang.String name,
                                                   StructureObject strucObject,
                                                   int maxType)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Get value from XML and convert it to String.
        Parameters:
        name - Fields name
        strucObject - Refrence to structure Object
        maxType - Give MaxType as Integer
        Returns:
        string value
        Throws:
        MXException
        java.rmi.RemoteException
      • getMboValue

        public static java.lang.String getMboValue(java.lang.String name,
                                                   MboRemote mbo,
                                                   int maxType)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Get value from XML and convert it to String.
        Parameters:
        name - Fields name
        mbo - Refrence to Mbo Object
        maxType - Give MaxType as Integer
        Returns:
        column value as string
        Throws:
        MXException
        java.rmi.RemoteException
      • getMboValueAsXMLValue

        public static java.lang.String getMboValueAsXMLValue(java.lang.String mboAttrName,
                                                             MboRemote mbo,
                                                             int maxType)
                                                      throws MXException,
                                                             java.rmi.RemoteException
        Get value from XML and convert it to String.
        Parameters:
        name - Fields name
        mbo - Refrence to Mbo Object
        maxType - Give MaxType as Integer
        Returns:
        column value as string
        Throws:
        MXException
        java.rmi.RemoteException
      • getMboValueAsObject

        public static java.lang.Object getMboValueAsObject(java.lang.String name,
                                                           MboRemote mbo,
                                                           int maxType)
                                                    throws MXException,
                                                           java.rmi.RemoteException
        Get value from Mbo as object.
        Parameters:
        name - Fields name
        mbo - Refrence to Mbo Object
        maxType - Give MaxType as Integer
        Returns:
        column value as string
        Throws:
        MXException
        java.rmi.RemoteException
      • getValueAsObject

        public static java.lang.Object getValueAsObject(java.lang.String value,
                                                        int maxType)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Get value from XML and convert it to String.
        Parameters:
        name - Fields name
        strucObject - Refrence to structure Object
        maxType - Give MaxType as Integer
        Returns:
        string value
        Throws:
        MXException
        java.rmi.RemoteException
      • getValueAsLocalazedString

        public static java.lang.String getValueAsLocalazedString(java.lang.String value,
                                                                 int maxType,
                                                                 java.util.Locale locale)
                                                          throws MXException,
                                                                 java.rmi.RemoteException
        Get value from XML and convert it to String.
        Parameters:
        name - Fields name
        strucObject - Refrence to structure Object
        maxType - Give MaxType as Integer
        Returns:
        string value
        Throws:
        MXException
        java.rmi.RemoteException
      • setValueAsObject

        public static void setValueAsObject(java.lang.String attributeName,
                                            StructureObject str,
                                            java.lang.String value,
                                            int maxType)
                                     throws MXException
        Get value from XML and convert it to String.
        Parameters:
        name - Fields name
        strucObject - Refrence to structure Object
        maxType - Give MaxType as Integer
        Throws:
        MXException