View Javadoc

1   package se.citerus.dddsample.domain.model.handling;
2   
3   import se.citerus.dddsample.domain.model.voyage.VoyageNumber;
4   
5   /**
6    * Thrown when trying to register an event with an unknown carrier movement id.
7    */
8   public class UnknownVoyageException extends CannotCreateHandlingEventException {
9   
10    private final VoyageNumber voyageNumber;
11  
12    public UnknownVoyageException(VoyageNumber voyageNumber) {
13      this.voyageNumber = voyageNumber;
14    }
15  
16    @Override
17    public String getMessage() {
18      return "No voyage with number " + voyageNumber.idString() + " exists in the system";
19    }
20  }