#11 Added supporting class and exception
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
31
src/main/java/de/rwu/easydrop/model/ProductPair.java
Normal file
31
src/main/java/de/rwu/easydrop/model/ProductPair.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user