Class FallbackIdMethod

  • All Implemented Interfaces:
    IdMethod

    public class FallbackIdMethod
    extends Object
    implements IdMethod
    Identification method implementation that first tries a parent id method, and, if no item is found and the identifier is a number, tries to load the item by id.
    Version:
    2.8
    Author:
    nicklas
    Last modified
    $Date: 2019-02-27 14:18:43 +0100 (ons, 27 feb. 2019) $
    • Field Detail

      • NAME_OR_ID

        public static final FallbackIdMethod NAME_OR_ID
        Use the name for finding items. If no item is found and the identifier is numerical, try loading it by ID.
      • NAME_OR_EXTERNALID_OR_ID

        public static final FallbackIdMethod NAME_OR_EXTERNALID_OR_ID
      • NAME_OR_BARCODE_OR_ID

        public static final FallbackIdMethod NAME_OR_BARCODE_OR_ID
      • NAME_OR_SYSTEMID_OR_ID

        public static final FallbackIdMethod NAME_OR_SYSTEMID_OR_ID
        Use the name or system ID for finding items. If no item is found and the identifier is numerical, try loading it by ID.
        Since:
        3.0
      • NAME_OR_UNITSYMBOL_OR_ID

        public static final FallbackIdMethod NAME_OR_UNITSYMBOL_OR_ID
        ID method that can be used for units. Use the name or unit symbol for finding items. If no item is found and the identifier is numerical, try loading it by ID.
        Since:
        3.8
      • method

        private final String method
      • title

        private final String title
    • Constructor Detail

      • FallbackIdMethod

        public FallbackIdMethod​(String method,
                                String title,
                                IdMethod parent)
        Create a new id method.
        Parameters:
        method - The method name, which should be unique among all methods
        title - The title to use for display purposes
        parent - The parent id method, which will be tried first