Example usage for org.joda.time TimeOfDay toString

List of usage examples for org.joda.time TimeOfDay toString

Introduction

In this page you can find the example usage for org.joda.time TimeOfDay toString.

Prototype

public String toString() 

Source Link

Document

Output the time in the ISO8601 format THH:mm:ss.SSS.

Usage

From source file:org.jadira.usertype.dateandtime.joda.columnmapper.IntegerColumnTimeOfDayMapper.java

License:Apache License

@Override
public String toNonNullString(TimeOfDay value) {
    return value.toString();
}

From source file:org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnTimeOfDayMapper.java

License:Apache License

@Override
public String toNonNullValue(TimeOfDay value) {

    if (value.getMillisOfSecond() == 0) {
        if (value.getSecondOfMinute() == 0) {
            return Formatter.LOCAL_TIME_NOSECONDS_PRINTER.print(value);
        }/*from  ww w .  ja v a2 s  .  c o  m*/
        return Formatter.LOCAL_TIME_NOMILLIS_PRINTER.print(value);
    } else {
        return value.toString().substring(1);
    }
}