ValueObject.java 433B

123456789101112131415161718
  1. package se.citerus.dddsample.domain.model;
  2. /**
  3. * A value object, as described in the DDD book.
  4. *
  5. */
  6. public interface ValueObject<T> {
  7. /**
  8. * Value objects compare by the values of their attributes, they don't have an identity.
  9. *
  10. * @param other The other value object.
  11. * @return <code>true</code> if the given value object's and this value object's attributes are the same.
  12. */
  13. boolean sameValueAs(T other);
  14. }