Enum LocalDateTimeStringConverter

  • All Implemented Interfaces:
    com.alibaba.excel.converters.Converter<java.time.LocalDateTime>, java.io.Serializable, java.lang.Comparable<LocalDateTimeStringConverter>

    public enum LocalDateTimeStringConverter
    extends java.lang.Enum<LocalDateTimeStringConverter>
    implements com.alibaba.excel.converters.Converter<java.time.LocalDateTime>
    LocalDateTime and string converter
    Author:
    L.cm
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      INSTANCE
      实例
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String MINUS  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.alibaba.excel.metadata.data.WriteCellData<java.lang.String> convertToExcelData​(java.time.LocalDateTime value, com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty, com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration)  
      java.time.LocalDateTime convertToJavaData​(com.alibaba.excel.metadata.data.ReadCellData cellData, com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty, com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration)  
      com.alibaba.excel.enums.CellDataTypeEnum supportExcelTypeKey()  
      java.lang.Class supportJavaTypeKey()  
      private static java.lang.String switchDateFormat​(java.lang.String dateString)
      switch date format
      static LocalDateTimeStringConverter valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static LocalDateTimeStringConverter[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.alibaba.excel.converters.Converter

        convertToExcelData, convertToJavaData
    • Constructor Detail

      • LocalDateTimeStringConverter

        private LocalDateTimeStringConverter()
    • Method Detail

      • values

        public static LocalDateTimeStringConverter[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (LocalDateTimeStringConverter c : LocalDateTimeStringConverter.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LocalDateTimeStringConverter valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • supportJavaTypeKey

        public java.lang.Class supportJavaTypeKey()
        Specified by:
        supportJavaTypeKey in interface com.alibaba.excel.converters.Converter<java.time.LocalDateTime>
      • supportExcelTypeKey

        public com.alibaba.excel.enums.CellDataTypeEnum supportExcelTypeKey()
        Specified by:
        supportExcelTypeKey in interface com.alibaba.excel.converters.Converter<java.time.LocalDateTime>
      • convertToJavaData

        public java.time.LocalDateTime convertToJavaData​(com.alibaba.excel.metadata.data.ReadCellData cellData,
                                                         com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty,
                                                         com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration)
                                                  throws java.text.ParseException
        Specified by:
        convertToJavaData in interface com.alibaba.excel.converters.Converter<java.time.LocalDateTime>
        Throws:
        java.text.ParseException
      • convertToExcelData

        public com.alibaba.excel.metadata.data.WriteCellData<java.lang.String> convertToExcelData​(java.time.LocalDateTime value,
                                                                                                  com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty,
                                                                                                  com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration)
        Specified by:
        convertToExcelData in interface com.alibaba.excel.converters.Converter<java.time.LocalDateTime>
      • switchDateFormat

        private static java.lang.String switchDateFormat​(java.lang.String dateString)
        switch date format
        Parameters:
        dateString - dateString
        Returns:
        pattern