Class ObjectsTriple<T>


  • public class ObjectsTriple<T>
    extends Object
    Represents a triple of objects of any type.
    • Constructor Detail

      • ObjectsTriple

        public ObjectsTriple()
        Creates an empty triple.
      • ObjectsTriple

        public ObjectsTriple​(T main,
                             T other,
                             T ancestor)
        Creates a triple of objects.
        Parameters:
        main - the main object
        other - the other object
        ancestor - the ancestor object
    • Method Detail

      • set

        public void set​(ComparisonSide side,
                        T object)
        Sets the object for the specified side.
        Parameters:
        side - the side to set the object for, not null
        object - the object to set
      • get

        public T get​(ComparisonSide side)
        Returns an object for the specified side.
        Parameters:
        side - the side to get the object for, not null
        Returns:
        the object on the side, may be null
      • getSide

        public ComparisonSide getSide()
        Returns the side where the object presents if it presents only on the one of possible sides.
        Returns:
        the side where the object presents or null if it presents on more than one side
      • getOrigin

        public ComparisonSide getOrigin()
        Returns MAIN or OTHER side if the object presents only on the one of them. Fully ignores object's presence on COMMON_ANCESTOR side.
        Returns:
        the MAIN or OTHER side or null if it presents on both of them or doesn't present on any of them
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object