Class TicketSummaryForTargetValueObject
- All Implemented Interfaces:
Serializable
TicketTargetStatus.
Why this is a subtype rather than a field on TicketSearchHitValueObject
targetStatus is per-TARGET and a ticket can hold many, so it is not a property of the
ticket. TicketSearchHitValueObject is also produced by
TicketDaoImpl.buildSearchHitHql, which selects from Ticket with no join to
t.targets and so has no target to report a status for. A nullable field on the shared VO
would therefore be populated on the bulk summaries route and null on every search route, and that
null would be indistinguishable from a TicketTargetStatus.NOT_DONE that failed to load
— the reading that NOT_DONE default exists to make impossible.
As a subtype the field exists only where it is always populated. Callers wanting the ticket alone keep the base type, and the JSON is the same object with one more key.
Note the shape this carries: findOpenSummariesForTargets returns one of these per
(ticket, target) pair, keyed by target id, so within one target's list every entry is that
target's own status. Nothing folds across a ticket's other targets.
- Author:
- gembro
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTicketSummaryForTargetValueObject(Long id, String title, TicketState state, TicketType type, long targetCount, Date updatedAt, TicketPriority priority, TicketTargetStatus targetStatus) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThis target's status on this ticket.inthashCode()voidsetTargetStatus(TicketTargetStatus targetStatus) This target's status on this ticket.toString()Methods inherited from class TicketSearchHitValueObject
fromRow, getId, getPriority, getState, getTargetCount, getTitle, getType, getUpdatedAt, setId, setPriority, setState, setTargetCount, setTitle, setType, setUpdatedAt
-
Constructor Details
-
TicketSummaryForTargetValueObject
public TicketSummaryForTargetValueObject() -
TicketSummaryForTargetValueObject
public TicketSummaryForTargetValueObject(Long id, String title, TicketState state, TicketType type, long targetCount, Date updatedAt, TicketPriority priority, TicketTargetStatus targetStatus)
-
-
Method Details
-
getTargetStatus
This target's status on this ticket. Never null:TicketTargetdefaults it toTicketTargetStatus.NOT_DONE. -
setTargetStatus
This target's status on this ticket. Never null:TicketTargetdefaults it toTicketTargetStatus.NOT_DONE. -
toString
- Overrides:
toStringin classTicketSearchHitValueObject
-
equals
- Overrides:
equalsin classTicketSearchHitValueObject
-
canEqual
- Overrides:
canEqualin classTicketSearchHitValueObject
-
hashCode
public int hashCode()- Overrides:
hashCodein classTicketSearchHitValueObject
-