Class InMemoryJobEvent

java.lang.Object
it.tidalwave.accounting.model.impl.InMemoryJobEvent
All Implemented Interfaces:
JobEvent, it.tidalwave.role.Identifiable, it.tidalwave.util.As
Direct Known Subclasses:
InMemoryFlatJobEvent, InMemoryJobEventGroup, InMemoryTimedJobEvent

@Immutable public abstract class InMemoryJobEvent extends Object implements JobEvent
This class models a single job event.
Author:
Fabrizio Giudici
  • Field Details

    • id

      @Nonnull protected final it.tidalwave.util.Id id
    • name

      @Nonnull protected final String name
    • description

      @Nonnull protected final String description
  • Constructor Details

    • InMemoryJobEvent

      protected InMemoryJobEvent(@Nonnull JobEvent.Builder builder)
      Creates a new instance from a builder.
      Parameters:
      builder - the builder
  • Method Details

    • builder

      @Nonnull public static JobEvent.Builder builder()
      Creates a new builder.
      Returns:
      the builder
    • getDateTime

      @Nonnull public abstract LocalDateTime getDateTime()
      Returns the datetime of the event.
      Returns:
      the date
    • getDuration

      @Nonnull public abstract Duration getDuration()
      Returns the duration of the event.
      Returns:
      the duration
    • getEarnings

      @Nonnull public abstract Money getEarnings()
      Returns the earnings for the event.
      Returns:
      the earnings
    • toBuilder

      @Nonnull public abstract JobEvent.Builder toBuilder()
      Returns a builder pre-populated with all the attributes.
      Specified by:
      toBuilder in interface JobEvent
      Returns:
      the builder