Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for getAsObject (0.13 sec)

  1. src/test/java/org/codelibs/core/beans/converter/TimestampConverterTest.java

        public void testGetAsObjectAndGetAsString() throws Exception {
            final TimestampConverter converter = new TimestampConverter("yyyy/MM/dd HH:mm:ss");
            final java.sql.Timestamp result = (java.sql.Timestamp) converter.getAsObject("2008/12/31 12:34:56");
            System.out.println(result);
            assertThat(converter.getAsString(result), is("2008/12/31 12:34:56"));
        }
    
        /**
         * @throws Exception
         */
        @Test
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  2. src/test/java/org/codelibs/core/beans/converter/SqlDateConverterTest.java

         */
        @Test
        public void testGetAsObjectAndGetAsString() throws Exception {
            final SqlDateConverter converter = new SqlDateConverter("yyyy/MM/dd");
            final java.sql.Date result = (java.sql.Date) converter.getAsObject("2008/01/16");
            System.out.println(result);
            assertThat(converter.getAsString(result), is("2008/01/16"));
        }
    
        /**
         * @throws Exception
         */
        @Test
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  3. src/test/java/org/codelibs/core/beans/converter/NumberConverterTest.java

        /**
         * @throws Exception
         */
        @Test
        public void testGetAsObject() throws Exception {
            final NumberConverter converter = new NumberConverter("##0");
            assertThat(converter.getAsObject("100"), is((Object) Long.valueOf("100")));
        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testGetAsString() throws Exception {
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/core/beans/converter/DateConverterTest.java

         */
        @Test
        public void testGetAsObjectAndGetAsString() throws Exception {
            final DateConverter converter = new DateConverter("yyyy/MM/dd");
            final Date result = (Date) converter.getAsObject("2008/01/16");
            System.out.println(result);
            assertThat(converter.getAsString(result), is("2008/01/16"));
        }
    
        /**
         * @throws Exception
         */
        @Test
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  5. src/test/java/org/codelibs/core/beans/converter/TimeConverterTest.java

         */
        @Test
        public void testGetAsObjectAndGetAsString() throws Exception {
            final TimeConverter converter = new TimeConverter("HH:mm:ss");
            final java.sql.Time result = (java.sql.Time) converter.getAsObject("12:34:56");
            System.out.println(result);
            assertThat(converter.getAsString(result), is("12:34:56"));
        }
    
        /**
         * @throws Exception
         */
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  6. src/main/java/org/codelibs/core/beans/converter/NumberConverter.java

         *            数値のパターン
         */
        public NumberConverter(final String pattern) {
            assertArgumentNotEmpty("pattern", pattern);
            this.pattern = pattern;
        }
    
        @Override
        public Object getAsObject(final String value) {
            if (StringUtil.isEmpty(value)) {
                return null;
            }
            try {
                return new DecimalFormat(pattern).parse(value);
            } catch (final ParseException e) {
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/core/beans/converter/TimestampConverter.java

         *            日時のパターン
         */
        public TimestampConverter(final String pattern) {
            assertArgumentNotEmpty("pattern", pattern);
            this.pattern = pattern;
        }
    
        @Override
        public Object getAsObject(final String value) {
            if (isEmpty(value)) {
                return null;
            }
            return TimestampConversionUtil.toSqlTimestamp(value, pattern);
        }
    
        @Override
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  8. src/main/java/org/codelibs/core/beans/converter/DateConverter.java

         *            日付のパターン
         */
        public DateConverter(final String pattern) {
            assertArgumentNotEmpty("pattern", pattern);
            this.pattern = pattern;
        }
    
        @Override
        public Object getAsObject(final String value) {
            if (isEmpty(value)) {
                return null;
            }
            return DateConversionUtil.toDate(value, pattern);
        }
    
        @Override
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 2K bytes
    - Viewed (0)
  9. src/main/java/org/codelibs/core/beans/converter/TimeConverter.java

         *            時間のパターン
         */
        public TimeConverter(final String pattern) {
            assertArgumentNotEmpty("pattern", pattern);
            this.pattern = pattern;
        }
    
        @Override
        public Object getAsObject(final String value) {
            if (isEmpty(value)) {
                return null;
            }
            return TimeConversionUtil.toSqlTime(value, pattern);
        }
    
        @Override
    Registered: Fri Nov 01 20:58:10 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  10. fess-crawler-opensearch/src/main/java/org/codelibs/fess/crawler/service/impl/AbstractCrawlerService.java

                if (value instanceof Date) {
                    return DEFAULT_DATE_PRINTER.print(((Date) value).getTime());
                }
                return null;
            }
    
            @Override
            public Object getAsObject(final String value) {
                if (StringUtil.isEmpty(value)) {
                    return null;
                }
                return new Timestamp(DEFAULT_DATE_PRINTER.parseMillis(value));
            }
    
    Registered: Sun Nov 10 03:50:12 UTC 2024
    - Last Modified: Thu Nov 07 04:44:10 UTC 2024
    - 23.6K bytes
    - Viewed (0)
Back to top