ProfileQuery#
Describes what a load profile covers: a date range, the resources, the bucket size and which buckets list their tasks. Create one with new ProfileQuery(from, to), then wrap it in LoadProfileOptions for Project#loadProfile, or set it as PreviewOptions.profile.
Declaration#
;
ProfileQuery is a mutable record. equals and hashCode compare the public fields, and toString() prints them as ProfileQuery{from=…, to=…, …}.
Constructors#
ProfileQuery(Moment, Moment)#
public
Creates a query over [from, to) for every resource, on the derived basis, with no task lists.
| Name | Type | Description |
|---|---|---|
from |
Moment |
Start of the range (inclusive). |
to |
Moment |
End of the range (exclusive). |
The constructor doesn't validate the range. The call that reads the query checks it.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
from |
Moment |
constructor argument | Start of the range. The profile holds every bucket whose start lies in [from, to). |
to |
Moment |
constructor argument | End of the range (exclusive). |
resources |
Vec<Id> |
null |
Resources to profile, in this order. null profiles every resource. |
basis |
Basis |
null |
Bucket size. null derives it from SchedulingConfig.durationUnit. |
tasks |
ProfileTasks |
ProfileTasks.NONE |
Which buckets list their booked tasks in LoadBucket.tasks. |
Validation#
Project#loadProfile and Project#preview throw an InputException for an invalid query:
| Path | When |
|---|---|
to |
to <= from, or the range holds more than 100 000 buckets per resource |
resources |
resources names a resource that isn't in the project |
Methods#
withFrom, withTo, withResources, withBasis, withTasks#
public ProfileQuery
public ProfileQuery
public ProfileQuery
public ProfileQuery
public ProfileQuery
public ProfileQuery
Set the field and return this query, for chaining. The Collection overload of withResources copies the elements into a new Vec, so List.of(...) works; null sets the field to null.
copy#
public ProfileQuery
Returns a shallow copy. The copy shares the resources list with this query.
deepClone#
public ProfileQuery
Returns a copy with its own resources list.
Example#
;
;
Related#
LoadProfileOptions- options ofloadProfilethat wrap the queryLoadProfile- the profile the query producesProfileTasks- which buckets list their tasks- Resource load - querying a profile