APISonar


org.apache.isis.applib.value.Time.Time

> org > apache > isis > applib > value > Time > Time
org APIs apache APIs isis APIs applib APIs value APIs Time APIs Time APIs

Example 1
public void testParseEntryOfHoursMinutesSecondsText() throws Exception {
        final Object parsed = adapter.parseTextEntry(null, "8:30:45", null); 
        // I can't get the text parser to parse HH:mm:ss before HH:mm!!
        final Time expected = new Time(8, 30, 45);
        assertEquals(expected, parsed);
    }
Example 2
public void testParseEntryOfHoursAfterNow() throws Exception {
        final Object parsed = adapter.parseTextEntry(null, "+5H");
        assertEquals(new Time(2, 30, 25), parsed);
    }
Example 3
public void setUpObjects() throws Exception {
        context.checking(new Expectations() {
            {
                allowing(mockConfiguration).getString("isis.value.format.time");
                will(returnValue(null));
            }
        });

        TestClock.initialize();
        time = new Time(8, 13);
        holder = new FacetHolderImpl();
        setValue(adapter = new TimeValueSemanticsProvider(holder, mockConfiguration, mockContext));
    }
Example 4
public Time getTime(final String columnName) {
        try {
            final String string = set.getString(columnName);
            final DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");
            final DateTimeZone defaultTimeZone = Defaults.getTimeZone();
            final DateTime utcDate = formatter.withZone(defaultTimeZone).parseDateTime(string);
            return new Time(utcDate);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }