File tree Expand file tree Collapse file tree
axon/src/main/java/com/baeldung/axon/coreapi Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .baeldung .axon .coreapi .commands ;
2+
3+ import org .axonframework .modelling .command .TargetAggregateIdentifier ;
4+
5+ import java .util .Objects ;
6+
7+ public class ConfirmOrderCommand {
8+
9+ @ TargetAggregateIdentifier
10+ private final String orderId ;
11+
12+ public ConfirmOrderCommand (String orderId ) {
13+ this .orderId = orderId ;
14+ }
15+
16+ public String getOrderId () {
17+ return orderId ;
18+ }
19+
20+ @ Override
21+ public int hashCode () {
22+ return Objects .hash (orderId );
23+ }
24+
25+ @ Override
26+ public boolean equals (Object obj ) {
27+ if (this == obj ) {
28+ return true ;
29+ }
30+ if (obj == null || getClass () != obj .getClass ()) {
31+ return false ;
32+ }
33+ final ConfirmOrderCommand other = (ConfirmOrderCommand ) obj ;
34+ return Objects .equals (this .orderId , other .orderId );
35+ }
36+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package com .baeldung .axon .coreapi .commands ;
2+
3+ import java .util .Objects ;
4+
5+ import org .axonframework .modelling .command .TargetAggregateIdentifier ;
6+
7+ public class PlaceOrderCommand {
8+
9+ @ TargetAggregateIdentifier
10+ private final String orderId ;
11+ private final String product ;
12+
13+ public PlaceOrderCommand (String orderId , String product ) {
14+ this .orderId = orderId ;
15+ this .product = product ;
16+ }
17+
18+ public String getOrderId () {
19+ return orderId ;
20+ }
21+
22+ public String getProduct () {
23+ return product ;
24+ }
25+
26+ @ Override
27+ public int hashCode () {
28+ return Objects .hash (orderId , product );
29+ }
30+
31+ @ Override
32+ public boolean equals (Object obj ) {
33+ if (this == obj ) {
34+ return true ;
35+ }
36+ if (obj == null || getClass () != obj .getClass ()) {
37+ return false ;
38+ }
39+ final PlaceOrderCommand other = (PlaceOrderCommand ) obj ;
40+ return Objects .equals (this .orderId , other .orderId )
41+ && Objects .equals (this .product , other .product );
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ package com .baeldung .axon .coreapi .commands ;
2+
3+ import java .util .Objects ;
4+
5+ import org .axonframework .modelling .command .TargetAggregateIdentifier ;
6+
7+ public class ShipOrderCommand {
8+
9+ @ TargetAggregateIdentifier
10+ private final String orderId ;
11+
12+ public ShipOrderCommand (String orderId ) {
13+ this .orderId = orderId ;
14+ }
15+
16+ public String getOrderId () {
17+ return orderId ;
18+ }
19+
20+ @ Override
21+ public int hashCode () {
22+ return Objects .hash (orderId );
23+ }
24+
25+ @ Override
26+ public boolean equals (Object obj ) {
27+ if (this == obj ) {
28+ return true ;
29+ }
30+ if (obj == null || getClass () != obj .getClass ()) {
31+ return false ;
32+ }
33+ final ShipOrderCommand other = (ShipOrderCommand ) obj ;
34+ return Objects .equals (this .orderId , other .orderId );
35+ }
36+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package com .baeldung .axon .coreapi .events ;
2+
3+ import java .util .Objects ;
4+
5+ public class OrderConfirmedEvent {
6+
7+ private final String orderId ;
8+
9+ public OrderConfirmedEvent (String orderId ) {
10+ this .orderId = orderId ;
11+ }
12+
13+ public String getOrderId () {
14+ return orderId ;
15+ }
16+
17+ @ Override
18+ public int hashCode () {
19+ return Objects .hash (orderId );
20+ }
21+
22+ @ Override
23+ public boolean equals (Object obj ) {
24+ if (this == obj ) {
25+ return true ;
26+ }
27+ if (obj == null || getClass () != obj .getClass ()) {
28+ return false ;
29+ }
30+ final OrderConfirmedEvent other = (OrderConfirmedEvent ) obj ;
31+ return Objects .equals (this .orderId , other .orderId );
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ package com .baeldung .axon .coreapi .events ;
2+
3+ import java .util .Objects ;
4+
5+ public class OrderPlacedEvent {
6+
7+ private final String orderId ;
8+ private final String product ;
9+
10+ public OrderPlacedEvent (String orderId , String product ) {
11+ this .orderId = orderId ;
12+ this .product = product ;
13+ }
14+
15+ public String getOrderId () {
16+ return orderId ;
17+ }
18+
19+ public String getProduct () {
20+ return product ;
21+ }
22+
23+ @ Override
24+ public int hashCode () {
25+ return Objects .hash (orderId , product );
26+ }
27+
28+ @ Override
29+ public boolean equals (Object obj ) {
30+ if (this == obj ) {
31+ return true ;
32+ }
33+ if (obj == null || getClass () != obj .getClass ()) {
34+ return false ;
35+ }
36+ final OrderPlacedEvent other = (OrderPlacedEvent ) obj ;
37+ return Objects .equals (this .orderId , other .orderId )
38+ && Objects .equals (this .product , other .product );
39+ }
40+ }
Original file line number Diff line number Diff line change 1+ package com .baeldung .axon .coreapi .events ;
2+
3+ import java .util .Objects ;
4+
5+ public class OrderShippedEvent {
6+
7+ private final String orderId ;
8+
9+ public OrderShippedEvent (String orderId ) {
10+ this .orderId = orderId ;
11+ }
12+
13+ public String getOrderId () {
14+ return orderId ;
15+ }
16+
17+ @ Override
18+ public int hashCode () {
19+ return Objects .hash (orderId );
20+ }
21+
22+ @ Override
23+ public boolean equals (Object obj ) {
24+ if (this == obj ) {
25+ return true ;
26+ }
27+ if (obj == null || getClass () != obj .getClass ()) {
28+ return false ;
29+ }
30+ final OrderShippedEvent other = (OrderShippedEvent ) obj ;
31+ return Objects .equals (this .orderId , other .orderId );
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments