Java Code Examples for java.time.OffsetTime#toString()

The following examples show how to use java.time.OffsetTime#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TCKOffsetTime.java    From j2objc with Apache License 2.0 5 votes vote down vote up
@Test()
@UseDataProvider("provider_sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 2
Source File: OffsetTimeSerializer.java    From jackson-modules-java8 with Apache License 2.0 5 votes vote down vote up
@Override
public void serializeWithType(OffsetTime value, JsonGenerator g, SerializerProvider ctxt,
        TypeSerializer typeSer) throws IOException
{
    WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, ctxt,
            typeSer.typeId(value, serializationShape(ctxt)));
    // need to write out to avoid double-writing array markers
    if (typeIdDef.valueShape == JsonToken.START_ARRAY) {
        _serializeAsArrayContents(value, g, ctxt);
    } else {
        String str = (_formatter == null) ? value.toString() : value.format(_formatter);
        g.writeString(str);
    }
    typeSer.writeTypeSuffix(g, ctxt, typeIdDef);
}
 
Example 3
Source File: OffsetTimeSerializer.java    From jackson-modules-java8 with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(OffsetTime time, JsonGenerator g, SerializerProvider provider) throws IOException
{
    if (useTimestamp(provider)) {
        g.writeStartArray();
        _serializeAsArrayContents(time, g, provider);
        g.writeEndArray();
    } else {
        String str = (_formatter == null) ? time.toString() : time.format(_formatter);
        g.writeString(str);
    }
}
 
Example 4
Source File: TCKOffsetTime.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 5
Source File: TimestampColumnOffsetTimeMapper.java    From jadira with Apache License 2.0 4 votes vote down vote up
@Override
public String toNonNullString(OffsetTime value) {
    return value.toString();
}
 
Example 6
Source File: TimeColumnOffsetTimeMapper.java    From jadira with Apache License 2.0 4 votes vote down vote up
@Override
public String toNonNullString(OffsetTime value) {
    return value.toString();
}
 
Example 7
Source File: TCKOffsetTime.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 8
Source File: TCKOffsetTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 9
Source File: TCKOffsetTime.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 10
Source File: TCKOffsetTime.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 11
Source File: TCKOffsetTime.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 12
Source File: TCKOffsetTime.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 13
Source File: TCKOffsetTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 14
Source File: TCKOffsetTime.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 15
Source File: TCKOffsetTime.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 16
Source File: TCKOffsetTime.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 17
Source File: TCKOffsetTime.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}
 
Example 18
Source File: TCKOffsetTime.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider="sampleToString")
public void test_toString(int h, int m, int s, int n, String offsetId, String expected) {
    OffsetTime t = OffsetTime.of(h, m, s, n, ZoneOffset.of(offsetId));
    String str = t.toString();
    assertEquals(str, expected);
}