/** * A line item. * * @author Thomas Darimont * @author Oliver Gierke */ @Data @RequiredArgsConstructor(onConstructor = @__(@PersistenceConstructor)) public class LineItem { private final String caption; private final double price; int quantity = 1; public LineItem(String caption, double price, int quantity) { this(caption, price); this.quantity = quantity; } }
/** * A line item. * * @author Thomas Darimont * @author Oliver Gierke */ @Data @RequiredArgsConstructor(onConstructor = @__(@PersistenceConstructor)) public class LineItem { private final String caption; private final double price; int quantity = 1; public LineItem(String caption, double price, int quantity) { this(caption, price); this.quantity = quantity; } }
/** * Creates a new {@link Order} for the given {@link Customer}, shipping and billing {@link Address}. * * @param customer must not be {@literal null}. * @param shippingAddress must not be {@literal null}. * @param billingAddress can be {@literal null}. */ @PersistenceConstructor public Order(Customer customer, Address shippingAddress, Address billingAddress) { Assert.notNull(customer); Assert.notNull(shippingAddress); this.customer = customer; this.shippingAddress = shippingAddress; this.billingAddress = billingAddress; }
/** * Creates a new {@link Product} from the given name and description. * * @param name must not be {@literal null} or empty. * @param price must not be {@literal null} or less than or equal to zero. * @param description */ @PersistenceConstructor public Product(String name, BigDecimal price, String description) { Assert.hasText(name, "Name must not be null or empty!"); Assert.isTrue(BigDecimal.ZERO.compareTo(price) < 0, "Price must be greater than zero!"); this.name = name; this.price = price; this.description = description; }
/** * Creates a Sphere around the given center {@link Point} with the given radius. * * @param center must not be {@literal null}. * @param radius must not be {@literal null}. */ @PersistenceConstructor public Sphere(Point center, Distance radius) { Assert.notNull(center, "Center point must not be null!"); Assert.notNull(radius, "Radius must not be null!"); Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative!"); this.center = center; this.radius = radius; }
@AllArgsConstructor(access = AccessLevel.PRIVATE, onConstructor = @__(@PersistenceConstructor)) public class Category {
@AllArgsConstructor(onConstructor = @__(@PersistenceConstructor)) @Document public class Order {
@RequiredArgsConstructor(onConstructor = @__(@PersistenceConstructor)) @Document public class Order {
/** * The special persistence constructor to populate a {@code final} * properties from the source MongoDB document. * @param message the {@link Message} this document is assigned. * @param messageId the id of the {@link Message} as a separate persistent property. * @since 5.1 */ @PersistenceConstructor MessageDocument(Message<?> message, UUID messageId) { Assert.notNull(message, "'message' must not be null"); Assert.notNull(messageId, "'message' ID header must not be null"); this.message = message; this.messageId = messageId; }
@PersistenceConstructor Baz(String name) { this.name = name; }
@PersistenceConstructor Abc(String name) { this.name = name; }
@PersistenceConstructor Xyz(String name) { this.name = name; }
/** * Creates a Sphere around the given center {@link Point} with the given radius. * * @param center must not be {@literal null}. * @param radius must not be {@literal null}. */ @PersistenceConstructor public Sphere(Point center, Distance radius) { Assert.notNull(center, "Center point must not be null!"); Assert.notNull(radius, "Radius must not be null!"); Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative!"); this.center = center; this.radius = radius; }
@PersistenceConstructor public RequiredFieldValidator(final I18nText errorMessage) { super(errorMessage); id = null; }
@PersistenceConstructor public MongoRememberMeToken(final String username, final String series, final String tokenValue, final Date date, final ObjectId id) { super(username, series, tokenValue, date); this.id = id; }
/** * Creates a {@link Point} from the given {@code x}, {@code y} coordinate. * * @param x * @param y */ @PersistenceConstructor public Point(double x, double y) { this.x = x; this.y = y; }
@PersistenceConstructor public User(String userId, String username, String password, String name, String email, Date registrationDate, Set<String> roles) { this.userId = userId; this.username = username; this.password = password; this.name = name; this.email = email; this.registrationDate = registrationDate; this.roles = roles; }
@PersistenceConstructor @ConstructorProperties({"accountId", "iban", "bban", "pan", "maskedPan", "msisdn", "currency"}) public AspspAccountReference(String accountId, String iban, String bban, String pan, String maskedPan, String msisdn, Currency currency) { this.accountId = accountId; this.iban = iban; this.bban = bban; this.pan = pan; this.maskedPan = maskedPan; this.msisdn = msisdn; this.currency = currency; } }
@PersistenceConstructor public ExprValidator(@JsonProperty(value = "expr") Expr expr, @JsonProperty(value = "errorMessage") I18nText errorMessage) { this.expr = expr; this.errorMessage = errorMessage; }
@PersistenceConstructor @ConstructorProperties({"accountId", "iban", "bban", "pan", "maskedPan", "msisdn", "currency"}) public AspspAccountReference(String accountId, String iban, String bban, String pan, String maskedPan, String msisdn, Currency currency) { this.accountId = accountId; this.iban = iban; this.bban = bban; this.pan = pan; this.maskedPan = maskedPan; this.msisdn = msisdn; this.currency = currency; } }