Class JAXBEqualsStrategy

java.lang.Object
org.jvnet.basicjaxb.lang.DefaultEqualsStrategy
org.jvnet.basicjaxb.lang.JAXBEqualsStrategy
All Implemented Interfaces:
EqualsStrategy

public class JAXBEqualsStrategy extends DefaultEqualsStrategy
Extend the DefaultEqualsStrategy by overriding the Object strategy and providing strategies for List and JAXBElement.
  • Constructor Details

    • JAXBEqualsStrategy

      public JAXBEqualsStrategy()
  • Method Details

    • getInstance

      public static JAXBEqualsStrategy getInstance()
      Get the single instance of JAXBEqualsStrategy.
      Returns:
      The single instance of JAXBEqualsStrategy.
    • equalsInternal

      protected boolean equalsInternal(ObjectLocator lhsLocator, ObjectLocator rhsLocator, Object lhs, Object rhs)
      Extend the default Object method to dispatch strategies for List and JAXBElement.
      Overrides:
      equalsInternal in class DefaultEqualsStrategy
    • equalsInternal

      protected boolean equalsInternal(ObjectLocator lhsLocator, ObjectLocator rhsLocator, List<?> lhs, List<?> rhs)
      Provide an equals strategy for List to iterate over the element pairs in the two lists and test each pair for Object equality.
      Parameters:
      lhsLocator - The left hand side object locator.
      rhsLocator - The right hand side object locator.
      lhs - The left hand side list.
      rhs - The right hand side list.
      Returns:
      True when all element pairs are equal and both lists are exhausted; otherwise, false.
    • equalsInternal

      protected boolean equalsInternal(ObjectLocator lhsLocator, ObjectLocator rhsLocator, jakarta.xml.bind.JAXBElement<?> lhs, jakarta.xml.bind.JAXBElement<?> rhs)
      Provide an equals strategy for JAXBElement to equate by XML element tag and by by value Object.
      Parameters:
      lhsLocator - The left hand side object locator.
      rhsLocator - The right hand side object locator.
      lhs - The left hand side JAXBElement.
      rhs - The right hand side JAXBElement.
      Returns:
      True when the element tags and values are equal; otherwise, false.