Matthew Brown wrote:You could write your own wrapper class. Each instance of your class contains an instance of Order. You write getter methods that delegate to Order, but don't write any setters. You'll need a constructor to set all Tue values on creation.
That's not enough. All getters must return defensive copies of the data it returns. For instance, it can't return
order.getOrderDate() since Date is mutable. It must therefore return a clone of that date instead. The same needs to be done for all mutable values; the ArrayList can be wrapped using Collections.unmodifiableList.