Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Last active July 8, 2016 03:07
Show Gist options
  • Save brunokrebs/160e20ce78205bb926b7f18aaf4077e0 to your computer and use it in GitHub Desktop.
Save brunokrebs/160e20ce78205bb926b7f18aaf4077e0 to your computer and use it in GitHub Desktop.
package com.someaddress.model;
public class Product {
// properties (already defined before)
public Product() { }
// getters ... (see? no setters)
public void handleDetailsUpdate(DetailsUpdateIntent intent) {
Assert.isTrue(intent.getPrice().compareTo(BigDecimal.ZERO) > 0);
this.name = intent.getName();
this.description = intent.getDescription();
this.price = intent.getPrice();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment