@Test public void hashCodeOfDifferentFunctionalMode() { DeviceInfo deviceInfo1 = new DeviceInfo( STANDARD_VERSION, VENDOR_EXTENSION_ID, VENDOR_EXTENSION_VERSION, VENDOR_EXTENSION_DESC, new UINT16(0), OPERATIONS_SUPPORTED, EVENTS_SUPPORTED, DEVICE_PROPERTIES_SUPPORTED, CAPTURE_FORMATS, IMAGE_FORMATS, MANUFACTURER, MODEL, DEVICE_VERSION, SERIAL_NUMBER); DeviceInfo deviceInfo2 = new DeviceInfo( STANDARD_VERSION, VENDOR_EXTENSION_ID, VENDOR_EXTENSION_VERSION, VENDOR_EXTENSION_DESC, new UINT16(1), OPERATIONS_SUPPORTED, EVENTS_SUPPORTED, DEVICE_PROPERTIES_SUPPORTED, CAPTURE_FORMATS, IMAGE_FORMATS, MANUFACTURER, MODEL, DEVICE_VERSION, SERIAL_NUMBER); assertThat(deviceInfo1.hashCode(), not(deviceInfo2.hashCode())); }
@Override public int hashCode() { return new HashCodeBuilder() .append(standardVersion) .append(vendorExtensionID) .append(vendorExtensionVersion) .append(vendorExtensionDesc) .append(functionalMode) .append(operationsSupported) .append(eventsSupported) .append(devicePropertiesSupported) .append(captureFormats) .append(imageFormats) .append(manufacturer) .append(model) .append(deviceVersion) .append(serialNumber) .toHashCode(); }
DeviceInfo { @Override public int hashCode() { return new HashCodeBuilder() .append(standardVersion) .append(vendorExtensionID) .append(vendorExtensionVersion) .append(vendorExtensionDesc) .append(functionalMode) .append(operationsSupported) .append(eventsSupported) .append(devicePropertiesSupported) .append(captureFormats) .append(imageFormats) .append(manufacturer) .append(model) .append(deviceVersion) .append(serialNumber) .toHashCode(); } }
DeviceInfo { @Override public int hashCode() { return new HashCodeBuilder() .append(standardVersion) .append(vendorExtensionID) .append(vendorExtensionVersion) .append(vendorExtensionDesc) .append(functionalMode) .append(operationsSupported) .append(eventsSupported) .append(devicePropertiesSupported) .append(captureFormats) .append(imageFormats) .append(manufacturer) .append(model) .append(deviceVersion) .append(serialNumber) .toHashCode(); } DeviceInfo(
            UINT16 standardVersion,
            UINT32 vendorExtensionID, UINT16 vendorExtensionVersion, String vendorExtensionDesc,
            UINT16 functionalMode,
            List<UINT16> operationsSupported, List<UINT16> eventsSupported, List<UINT16> devicePropertiesSupported,
            List<UINT16> captureFormats, List<UINT16> imageFormats,
            String manufacturer, String model, String deviceVersion, String serialNumber); }
DeviceInfo { @Override public int hashCode() { return new HashCodeBuilder() .append(standardVersion) .append(vendorExtensionID) .append(vendorExtensionVersion) .append(vendorExtensionDesc) .append(functionalMode) .append(operationsSupported) .append(eventsSupported) .append(devicePropertiesSupported) .append(captureFormats) .append(imageFormats) .append(manufacturer) .append(model) .append(deviceVersion) .append(serialNumber) .toHashCode(); } DeviceInfo(
            UINT16 standardVersion,
            UINT32 vendorExtensionID, UINT16 vendorExtensionVersion, String vendorExtensionDesc,
            UINT16 functionalMode,
            List<UINT16> operationsSupported, List<UINT16> eventsSupported, List<UINT16> devicePropertiesSupported,
            List<UINT16> captureFormats, List<UINT16> imageFormats,
            String manufacturer, String model, String deviceVersion, String serialNumber); static DeviceInfo read(InputStream is); static DeviceInfo read(PtpInputStream pis); UINT16 getStandardVersion(); UINT32 getVendorExtensionID(); UINT16 getVendorExtensionVersion(); String getVendorExtensionDesc(); UINT16 getFunctionalMode(); List<UINT16> getOperationsSupported(); List<UINT16> getEventsSupported(); List<UINT16> getDevicePropertiesSupported(); List<UINT16> getCaptureFormats(); List<UINT16> getImageFormats(); String getManufacturer(); String getModel(); String getDeviceVersion(); String getSerialNumber(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
DeviceInfo { @Override public int hashCode() { return new HashCodeBuilder() .append(standardVersion) .append(vendorExtensionID) .append(vendorExtensionVersion) .append(vendorExtensionDesc) .append(functionalMode) .append(operationsSupported) .append(eventsSupported) .append(devicePropertiesSupported) .append(captureFormats) .append(imageFormats) .append(manufacturer) .append(model) .append(deviceVersion) .append(serialNumber) .toHashCode(); } DeviceInfo(
            UINT16 standardVersion,
            UINT32 vendorExtensionID, UINT16 vendorExtensionVersion, String vendorExtensionDesc,
            UINT16 functionalMode,
            List<UINT16> operationsSupported, List<UINT16> eventsSupported, List<UINT16> devicePropertiesSupported,
            List<UINT16> captureFormats, List<UINT16> imageFormats,
            String manufacturer, String model, String deviceVersion, String serialNumber); static DeviceInfo read(InputStream is); static DeviceInfo read(PtpInputStream pis); UINT16 getStandardVersion(); UINT32 getVendorExtensionID(); UINT16 getVendorExtensionVersion(); String getVendorExtensionDesc(); UINT16 getFunctionalMode(); List<UINT16> getOperationsSupported(); List<UINT16> getEventsSupported(); List<UINT16> getDevicePropertiesSupported(); List<UINT16> getCaptureFormats(); List<UINT16> getImageFormats(); String getManufacturer(); String getModel(); String getDeviceVersion(); String getSerialNumber(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }