#11 Added supporting class and exception

This commit is contained in:
Shan Ruhhammer
2023-06-25 03:04:56 +02:00
parent 5f6fa3fec9
commit 4c3f6ebe82
2 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package de.rwu.easydrop.exception;
/**
* Exception that signifies the data of a Product are invalid.
*
* @since 0.3.0
*/
public class InvalidCatalogueException extends RuntimeException {
/**
* Throws an exception that signifies the data of a Product are invalid.
*
* @param message
*/
public InvalidCatalogueException(final String message) {
super(message);
}
/**
* Throws an exception that signifies the data of a Product are invalid.
*
* @param message
* @param cause
*/
public InvalidCatalogueException(final String message, final Throwable cause) {
super(message, cause);
}
}

View File

@@ -0,0 +1,31 @@
package de.rwu.easydrop.model;
import lombok.Data;
/**
* Associates two related Products to one another.
*
* @since 0.3.0
*/
@Data
public class ProductPair {
/**
* The first product.
*/
private final Product product1;
/**
* The second product.
*/
private final Product product2;
/**
* Constructs a Product Pair.
*
* @param a First product
* @param b Second product
*/
public ProductPair(final Product a, final Product b) {
this.product1 = a;
this.product2 = b;
}
}