Changed fields to private final and added public access method for them.

This is needed for writing mock tests.