Package hudson.model.queue
Class ScheduleResult
- java.lang.Object
-
- hudson.model.queue.ScheduleResult
-
- Direct Known Subclasses:
ScheduleResult.Created
,ScheduleResult.Existing
,ScheduleResult.Refused
public abstract class ScheduleResult extends Object
- Since:
- 1.521
- Author:
- Kohsuke Kawaguchi
- See Also:
Queue.schedule(Task, int, Action...)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScheduleResult.Created
static class
ScheduleResult.Existing
static class
ScheduleResult.Refused
-
Constructor Summary
Constructors Constructor Description ScheduleResult()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScheduleResult.Created
created(Queue.WaitingItem i)
static ScheduleResult.Existing
existing(Queue.Item i)
Queue.WaitingItem
getCreateItem()
IfisCreated()
returns true, then this method returns the newly created item, which is always of the typeQueue.WaitingItem
.Queue.Item
getItem()
UnlessisRefused()
is true, this method either returns the newly created item in the queue or the existing item that's already in the queue that matched the submitted task.boolean
isAccepted()
Opposite ofisRefused()
boolean
isCreated()
If true, thegetItem()
is newly created as a result ofQueue.schedule2(hudson.model.Queue.Task, int, java.util.List<hudson.model.Action>)
.boolean
isRefused()
The scheduling of the task was refused and the queue didn't change.static ScheduleResult.Refused
refused()
-
-
-
Method Detail
-
isCreated
public boolean isCreated()
If true, thegetItem()
is newly created as a result ofQueue.schedule2(hudson.model.Queue.Task, int, java.util.List<hudson.model.Action>)
.
-
isRefused
public boolean isRefused()
The scheduling of the task was refused and the queue didn't change. If this method returns true,getItem()
will return null.
-
getItem
@CheckForNull public Queue.Item getItem()
UnlessisRefused()
is true, this method either returns the newly created item in the queue or the existing item that's already in the queue that matched the submitted task.
-
getCreateItem
@CheckForNull public Queue.WaitingItem getCreateItem()
IfisCreated()
returns true, then this method returns the newly created item, which is always of the typeQueue.WaitingItem
.
-
isAccepted
public final boolean isAccepted()
Opposite ofisRefused()
-
created
public static ScheduleResult.Created created(Queue.WaitingItem i)
-
existing
public static ScheduleResult.Existing existing(Queue.Item i)
-
refused
public static ScheduleResult.Refused refused()
-
-