Example usage for org.joda.time LocalDateTime toLocalTime

List of usage examples for org.joda.time LocalDateTime toLocalTime

Introduction

In this page you can find the example usage for org.joda.time LocalDateTime toLocalTime.

Prototype

public LocalTime toLocalTime() 

Source Link

Document

Converts this object to a LocalTime with the same time and chronology.

Usage

From source file:org.estatio.dscm.services.SyncService.java

License:Apache License

/**
 * The effective playlist items e.g. the commercials and fillers combined in
 * cycles of 60 seconds. All videos take 10 seconds each for the time being
 * /*from w  w w  .  j a v a 2  s  .  c  o  m*/
 * @param playlist
 *            The main playlist e.g. commercial
 * @param dateTime
 *            The effective time
 * @return
 */
@Programmatic
public List<PlaylistItem> effectiveItems(Playlist playlist, LocalDateTime dateTime) {

    List<PlaylistItem> fillers = new ArrayList<PlaylistItem>();
    List<PlaylistItem> commercials = new ArrayList<PlaylistItem>();
    commercials.addAll(playlist.getItems());
    Playlist fillerPlaylist = playlists.findByDisplayGroupAndDateTimeAndType(playlist.getDisplayGroup(),
            dateTime.toLocalDate(), dateTime.toLocalTime(), PlaylistType.FILLERS);
    if (fillerPlaylist != null) {
        fillers.addAll(fillerPlaylist.getItems());
    }
    return PlaylistGenerator.generate(commercials, fillers, playlist.getLoopDuration());
}

From source file:org.jpmml.evaluator.FieldValue.java

License:Open Source License

public LocalTime asLocalTime() {
    Object value = getValue();//from   w ww .ja  v  a 2  s.c o  m

    if (value instanceof LocalTime) {
        return (LocalTime) value;
    } else

    if (value instanceof LocalDateTime) {
        LocalDateTime instant = (LocalDateTime) value;

        return instant.toLocalTime();
    }

    throw new TypeCheckException(DataType.TIME, value);
}