Berico-Technologies/CLAVIN — pull request #98 by mrburrito (2014-01-14 15:59:18+00:00)
Title: Encapsulate fields in output objects and provide getters for simpler Mock testing in applications using Clavin.

Fixes: https://github.com/Berico-Technologies/CLAVIN/issues/97

Encapsulated all fields in LocationOccurrence, GeoName and ResolvedLocation, making them private final and exposing them through getXxx() accessor methods so they can be tested with Mock objects. (e.g. Mockito, EasyMock, etc.) Also, updated GeoName so it defensively copies mutable properties (List, TimeZone, Date) on construction and when accessed so internal state cannot be modified by external pointers. Lists are copied and wrapped with Collections.unmodifiableList() in the constructor and never copied again. TimeZone and Date are copied at construction and in the getXxx() methods because they are inherently mutable. List properties (getAlternateXxx()) are guaranteed to always return an empty list and never null.