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
33
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt
package org.litesoft.codec;

import java.sql.*;

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

/**
 * 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
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