@Test(expected = IllegalStateOfArgumentException.class) public void appendBrowserBuilder_withoutType() { final DataBuilder b = new DataBuilder(); final Browser.Builder builder = new Browser.Builder(); builder.setId(1); builder.setFamilyName(UserAgentFamily.FIREFOX.getName()); b.appendBrowserBuilder(builder); }
@Nonnull public DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder) { Check.notNull(browserBuilder, "browserBuilder"); Check.notNegative(browserBuilder.getId(), "browserBuilder.getId()"); if (browserBuilder.getType() == null && browserBuilder.getTypeId() < 0) { throw new IllegalStateOfArgumentException("A Type or Type-ID of argument 'browserBuilder' must be set."); } if (browserBuilders.containsKey(browserBuilder.getId())) { throw new IllegalStateOfArgumentException("The browser builder '" + browserBuilder.getProducer() + " " + browserBuilder.getFamily() + "' is already in the map."); } final Browser.Builder builder = browserBuilder.copy(); browserBuilders.put(builder.getId(), builder); return this; }
DataBuilder { @Nonnull public DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder) { Check.notNull(browserBuilder, "browserBuilder"); Check.notNegative(browserBuilder.getId(), "browserBuilder.getId()"); if (browserBuilder.getType() == null && browserBuilder.getTypeId() < 0) { throw new IllegalStateOfArgumentException("A Type or Type-ID of argument 'browserBuilder' must be set."); } if (browserBuilders.containsKey(browserBuilder.getId())) { throw new IllegalStateOfArgumentException("The browser builder '" + browserBuilder.getProducer() + " " + browserBuilder.getFamily() + "' is already in the map."); } final Browser.Builder builder = browserBuilder.copy(); browserBuilders.put(builder.getId(), builder); return this; } }
DataBuilder { @Nonnull public DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder) { Check.notNull(browserBuilder, "browserBuilder"); Check.notNegative(browserBuilder.getId(), "browserBuilder.getId()"); if (browserBuilder.getType() == null && browserBuilder.getTypeId() < 0) { throw new IllegalStateOfArgumentException("A Type or Type-ID of argument 'browserBuilder' must be set."); } if (browserBuilders.containsKey(browserBuilder.getId())) { throw new IllegalStateOfArgumentException("The browser builder '" + browserBuilder.getProducer() + " " + browserBuilder.getFamily() + "' is already in the map."); } final Browser.Builder builder = browserBuilder.copy(); browserBuilders.put(builder.getId(), builder); return this; }  }
DataBuilder { @Nonnull public DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder) { Check.notNull(browserBuilder, "browserBuilder"); Check.notNegative(browserBuilder.getId(), "browserBuilder.getId()"); if (browserBuilder.getType() == null && browserBuilder.getTypeId() < 0) { throw new IllegalStateOfArgumentException("A Type or Type-ID of argument 'browserBuilder' must be set."); } if (browserBuilders.containsKey(browserBuilder.getId())) { throw new IllegalStateOfArgumentException("The browser builder '" + browserBuilder.getProducer() + " " + browserBuilder.getFamily() + "' is already in the map."); } final Browser.Builder builder = browserBuilder.copy(); browserBuilders.put(builder.getId(), builder); return this; }  DataBuilder appendBrowser(@Nonnull final Browser browser); @Nonnull DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder); @Nonnull DataBuilder appendBrowserOperatingSystemMapping(@Nonnull final BrowserOperatingSystemMapping browserOsMapping); @Nonnull DataBuilder appendBrowserPattern(@Nonnull final BrowserPattern pattern); @Nonnull DataBuilder appendBrowserType(@Nonnull final BrowserType type); DataBuilder appendDevice(@Nonnull final Device device); @Nonnull DataBuilder appendDeviceBuilder(@Nonnull final Device.Builder deviceBuilder); @Nonnull DataBuilder appendDevicePattern(@Nonnull final DevicePattern pattern); @Nonnull DataBuilder appendOperatingSystem(@Nonnull final OperatingSystem operatingSystem); @Nonnull DataBuilder appendOperatingSystemBuilder(@Nonnull final OperatingSystem.Builder operatingSystemBuilder); @Nonnull DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern); @Nonnull DataBuilder appendRobot(@Nonnull final Robot robot); @Nonnull Data build(); @Nonnull DataBuilder setVersion(@Nonnull final String version); }
DataBuilder { @Nonnull public DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder) { Check.notNull(browserBuilder, "browserBuilder"); Check.notNegative(browserBuilder.getId(), "browserBuilder.getId()"); if (browserBuilder.getType() == null && browserBuilder.getTypeId() < 0) { throw new IllegalStateOfArgumentException("A Type or Type-ID of argument 'browserBuilder' must be set."); } if (browserBuilders.containsKey(browserBuilder.getId())) { throw new IllegalStateOfArgumentException("The browser builder '" + browserBuilder.getProducer() + " " + browserBuilder.getFamily() + "' is already in the map."); } final Browser.Builder builder = browserBuilder.copy(); browserBuilders.put(builder.getId(), builder); return this; }  DataBuilder appendBrowser(@Nonnull final Browser browser); @Nonnull DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder); @Nonnull DataBuilder appendBrowserOperatingSystemMapping(@Nonnull final BrowserOperatingSystemMapping browserOsMapping); @Nonnull DataBuilder appendBrowserPattern(@Nonnull final BrowserPattern pattern); @Nonnull DataBuilder appendBrowserType(@Nonnull final BrowserType type); DataBuilder appendDevice(@Nonnull final Device device); @Nonnull DataBuilder appendDeviceBuilder(@Nonnull final Device.Builder deviceBuilder); @Nonnull DataBuilder appendDevicePattern(@Nonnull final DevicePattern pattern); @Nonnull DataBuilder appendOperatingSystem(@Nonnull final OperatingSystem operatingSystem); @Nonnull DataBuilder appendOperatingSystemBuilder(@Nonnull final OperatingSystem.Builder operatingSystemBuilder); @Nonnull DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern); @Nonnull DataBuilder appendRobot(@Nonnull final Robot robot); @Nonnull Data build(); @Nonnull DataBuilder setVersion(@Nonnull final String version);  }