Class VersionEnforcerVisitor<T>

  • Type Parameters:
    T - The type of object to visit (Mapping or MappingSet).
    All Implemented Interfaces:
    ISlotVisitor<T>

    public class VersionEnforcerVisitor<T>
    extends SlotVisitorBase<T>
    Helper object to forcibly remove from a set or a mapping all slots or slot values that are incompatible with a given version of the SSSOM specification.
    • Constructor Detail

      • VersionEnforcerVisitor

        public VersionEnforcerVisitor​(Version version)
        Creates a new instance.
        Parameters:
        version - The version of the SSSOM specification to be enforced.
    • Method Detail

      • visit

        public void visit​(Slot<T> slot,
                          T object,
                          Object unused)
        Description copied from interface: ISlotVisitor
        Visits a generic slot.

        This method is normally not used as all slots in a SSSOM object have more precise types. But it can be used to implement behaviours that should be common to several slot types.

        Specified by:
        visit in interface ISlotVisitor<T>
        Overrides:
        visit in class SlotVisitorBase<T>
        Parameters:
        slot - The slot that is being visited.
        object - The object to which the slot is attached.
        unused - The value of the slot.
      • visit

        public void visit​(EntityTypeSlot<T> slot,
                          T object,
                          EntityType value)
        Description copied from interface: ISlotVisitor
        Visits a slot that holds an entity type enumeration value.
        Specified by:
        visit in interface ISlotVisitor<T>
        Overrides:
        visit in class SlotVisitorBase<T>
        Parameters:
        slot - The slot that is being visited.
        object - The object to which the slot is attached.
        value - The value of the slot.