UserAgent implements ReadableUserAgent, Serializable { @Nonnull @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("UserAgent [deviceCategory="); builder.append(deviceCategory); builder.append(", family="); builder.append(family); builder.append(", icon="); builder.append(icon); builder.append(", name="); builder.append(name); builder.append(", operatingSystem="); builder.append(operatingSystem); builder.append(", producer="); builder.append(producer); builder.append(", producerUrl="); builder.append(producerUrl); builder.append(", type="); builder.append(type); builder.append(", typeName="); builder.append(typeName); builder.append(", url="); builder.append(url); builder.append(", versionNumber="); builder.append(versionNumber); builder.append("]"); return builder.toString(); } UserAgent(@Nonnull final DeviceCategory deviceType, @Nonnull final UserAgentFamily family, @Nonnull final String icon,
			@Nonnull final String name, @Nonnull final OperatingSystem operatingSystem, @Nonnull final String producer,
			@Nonnull final String producerUrl, @Nonnull final UserAgentType type, @Nonnull final String typeName,
			@Nonnull final String url, @Nonnull final VersionNumber versionNumber); @Override boolean equals(final Object obj); @Nonnull @Override DeviceCategory getDeviceCategory(); @Override UserAgentFamily getFamily(); @Override String getIcon(); @Override String getName(); @Override OperatingSystem getOperatingSystem(); @Override String getProducer(); @Override String getProducerUrl(); @Override UserAgentType getType(); @Override String getTypeName(); @Override String getUrl(); @Override VersionNumber getVersionNumber(); @Override int hashCode(); @Nonnull @Override String toString(); static final UserAgent EMPTY; }
@Test public void testToString() { final UserAgent ua = new UserAgent(DeviceCategory.EMPTY, UserAgentFamily.SAFARI, "i1", "n1", OperatingSystem.EMPTY, "p1", "pu1", UserAgentType.USERAGENT_ANONYMIZER, "t1", "u1", VersionParser.parseVersion("1")); assertThat(ua.toString()) .isEqualTo( "UserAgent [deviceCategory=" + DeviceCategory.EMPTY.toString() + ", family=SAFARI, icon=i1, name=n1, operatingSystem=" + OperatingSystem.EMPTY.toString() + ", producer=p1, producerUrl=pu1, type=USERAGENT_ANONYMIZER, typeName=t1, url=u1, versionNumber=VersionNumber [groups=[1, , ], extension=]]"); }