T
- the type of an optional user objectpublic class ActivityBase<T> extends Object implements Activity
Activity
interface.Modifier and Type | Field and Description |
---|---|
static Duration |
DEFAULT_DURATION |
protected Instant |
endTime |
protected String |
id |
protected String |
name |
protected Instant |
startTime |
protected T |
userObject |
Constructor and Description |
---|
ActivityBase()
Constructs a new activity.
|
ActivityBase(Instant startTime,
Instant endTime)
Constructs a new activity with the start time and end time.
|
ActivityBase(String name)
Constructs a new activity with the given name.
|
ActivityBase(String name,
Instant startTime,
Instant endTime)
Constructs a new activity with the given name, start time, and end time.
|
Modifier and Type | Method and Description |
---|---|
Instant |
getEndTime()
The end time of the activity.
|
String |
getId()
The unique id of the activity.
|
String |
getName()
The name of the activity, for example "Flight 3441".
|
Instant |
getStartTime()
The start time of the activity.
|
T |
getUserObject() |
String |
toString() |
public static Duration DEFAULT_DURATION
protected String name
protected String id
protected T userObject
protected Instant startTime
protected Instant endTime
public ActivityBase()
Instant.now()
and the end time will be equal to
Instant.now()
plus the value of DEFAULT_DURATION
.public ActivityBase(String name)
Instant.now()
and the end time will be equal to
Instant.now()
plus the value of DEFAULT_DURATION
.name
- the name of the activitypublic ActivityBase(Instant startTime, Instant endTime)
startTime
- the start time of the activityendTime
- the end time of the activitypublic String getName()
Activity
public String getId()
Activity
public T getUserObject()
public Instant getStartTime()
Activity
getStartTime
in interface Activity
public Instant getEndTime()
Activity
getEndTime
in interface Activity
Copyright © 2014 Dirk Lemmermann Software & Consulting. All rights reserved.