Data implements Serializable { @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("Data [browsers="); builder.append(browsers); builder.append(", browserPatterns="); builder.append(browserPatterns); builder.append(", browserTypes="); builder.append(browserTypes); builder.append(", patternToBrowserMap="); builder.append(patternToBrowserMap); builder.append(", browserToOperatingSystemMap="); builder.append(browserToOperatingSystemMappings); builder.append(", operatingSystems="); builder.append(operatingSystems); builder.append(", operatingSystemPatterns="); builder.append(operatingSystemPatterns); builder.append(", patternToOperatingSystemMap="); builder.append(patternToOperatingSystemMap); builder.append(", robots="); builder.append(robots); builder.append(", devices="); builder.append(devices); builder.append(", devicePatterns="); builder.append(devicePatterns); builder.append(", patternToDeviceMap="); builder.append(patternToDeviceMap); builder.append(", version="); builder.append(version); builder.append("]"); return builder.toString(); } Data(@Nonnull final Set<Browser> browsers, @Nonnull final Map<Integer, SortedSet<BrowserPattern>> browserPatterns,
			@Nonnull final Map<Integer, BrowserType> browserTypes, @Nonnull final SortedMap<BrowserPattern, Browser> patternToBrowserMap,
			@Nonnull final Set<BrowserOperatingSystemMapping> browserToOperatingSystemMappings,
			@Nonnull final Set<OperatingSystem> operatingSystems,
			@Nonnull final Map<Integer, SortedSet<OperatingSystemPattern>> operatingSystemPatterns,
			@Nonnull final SortedMap<OperatingSystemPattern, OperatingSystem> patternToOperatingSystemMap,
			@Nonnull final List<Robot> robots, @Nonnull final Set<Device> devices,
			@Nonnull final Map<Integer, SortedSet<DevicePattern>> devicePatterns,
			@Nonnull final SortedMap<DevicePattern, Device> patternToDeviceMap, @Nonnull final String version); @Override boolean equals(final Object obj); @Nonnull Map<Integer, SortedSet<BrowserPattern>> getBrowserPatterns(); @Nonnull Set<Browser> getBrowsers(); @Nonnull Set<BrowserOperatingSystemMapping> getBrowserToOperatingSystemMappings(); @Nonnull Map<Integer, BrowserType> getBrowserTypes(); @Nonnull Map<Integer, SortedSet<DevicePattern>> getDevicePatterns(); @Nonnull Set<Device> getDevices(); @Nonnull Map<Integer, SortedSet<OperatingSystemPattern>> getOperatingSystemPatterns(); @Nonnull Set<OperatingSystem> getOperatingSystems(); @Nonnull SortedMap<BrowserPattern, Browser> getPatternToBrowserMap(); @Nonnull SortedMap<DevicePattern, Device> getPatternToDeviceMap(); @Nonnull SortedMap<OperatingSystemPattern, OperatingSystem> getPatternToOperatingSystemMap(); @Nonnull List<Robot> getRobots(); @Nonnull String getVersion(); @Override int hashCode(); @Nonnull String toStats(); @Override String toString(); static final Data EMPTY; }
@Test public void testToString() { final Set<Browser> browsers = new HashSet<Browser>(); final Map<Integer, SortedSet<BrowserPattern>> browserPatterns = Maps.newHashMap(); final Map<Integer, BrowserType> browserTypes = Maps.newHashMap(); final SortedMap<BrowserPattern, Browser> patternToBrowserMap = new TreeMap<BrowserPattern, Browser>(); final Set<BrowserOperatingSystemMapping> browserToOperatingSystemMappings = Sets.newHashSet(); final Set<OperatingSystem> operatingSystems = new HashSet<OperatingSystem>(); final Map<Integer, SortedSet<OperatingSystemPattern>> operatingSystemPatterns = Maps.newHashMap(); final SortedMap<OperatingSystemPattern, OperatingSystem> patternToOperatingSystemMap = new TreeMap<OperatingSystemPattern, OperatingSystem>(); final List<Robot> robots = new ArrayList<Robot>(); final Set<Device> devices = new HashSet<Device>(0); final Map<Integer, SortedSet<DevicePattern>> devicePatterns = new HashMap<Integer, SortedSet<DevicePattern>>(0); final SortedMap<DevicePattern, Device> patternToDeviceMap = new TreeMap<DevicePattern, Device>(); final String version = "test"; final DataBlueprint dataBlueprint = new DataBlueprint(); dataBlueprint.browsers(browsers); dataBlueprint.browserPatterns(browserPatterns); dataBlueprint.browserTypes(browserTypes); dataBlueprint.patternToBrowserMap(patternToBrowserMap); dataBlueprint.browserToOperatingSystemMappings(browserToOperatingSystemMappings); dataBlueprint.operatingSystems(operatingSystems); dataBlueprint.operatingSystemPatterns(operatingSystemPatterns); dataBlueprint.patternToOperatingSystemMap(patternToOperatingSystemMap); dataBlueprint.robots(robots); dataBlueprint.devices(devices); dataBlueprint.devicePatterns(devicePatterns); dataBlueprint.patternToDeviceMap(patternToDeviceMap); dataBlueprint.version(version); final Data data = dataBlueprint.build(); assertThat(data.toString()) .isEqualTo( "Data [browsers=[], browserPatterns={}, browserTypes={}, patternToBrowserMap={}, browserToOperatingSystemMap=[], operatingSystems=[], operatingSystemPatterns={}, patternToOperatingSystemMap={}, robots=[], devices=[], devicePatterns={}, patternToDeviceMap={}, version=test]"); }