Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// This Source Code is in the Public Domain per: http://unlicense.org
package org.litesoft.codec;

import org.litesoft.commonfoundation.annotations.*;
import org.litesoft.commonfoundation.charstreams.*;

import java.sql.*;

/**
 * Convert Timestamp value to/from a self-terminating string representation
 */
public class TimestampTypedTerminatingCodec extends AbstractTemporalPartsTypedTerminatingCodec<Timestamp> {
    public static final TimestampTypedTerminatingCodec INSTANCE = new TimestampTypedTerminatingCodec();

    private TimestampTypedTerminatingCodec() {
        super( "Timestamp", YEAR, DASH, MONTH, DASH, DAY, SPACE, HOUR, COLON, MINUTE, COLON, SECOND, PERIOD, FRACTION );
    }

    @Override
    protected
    @NotNull
    void encodeNonNull( CharSink pCharSink, Timestamp pValue ) {
        encodeParts( pCharSink, pValue.toString() );
    }

    @Override
    protected
    @NotNull
    Timestamp decodeNonNull( CharSource pCharSource ) {
        return Timestamp.valueOf( decodeParts( pCharSource ) );
    }
}

Commits for litesoft/trunk/Java/core/Anywhere/src/org/litesoft/codec/TimestampTypedTerminatingCodec.java

Diff revisions: vs.
Revision Author Commited Message
950 Diff Diff GeorgeS picture GeorgeS Thu 19 Jun, 2014 17:57:04 +0000

New Lines

948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

947 Diff Diff GeorgeS picture GeorgeS Fri 06 Jun, 2014 23:36:56 +0000

Correct Spelling of package!

942 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 23:41:46 +0000

Extracting commonfoundation

939 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 21:30:31 +0000

Extracting commonfoundation

847 GeorgeS picture GeorgeS Fri 07 Sep, 2012 15:53:36 +0000