Class QuantityCode


  • public class QuantityCode
    extends CodeValidation
    Series of codes that can be used for quantities. These codes are used only in the context of the Extended profile.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BAG  
      static java.lang.String BARREL  
      static java.lang.String BOTTLE  
      static java.lang.String BOTTLECRATE  
      static java.lang.String BOX  
      static java.lang.String CAN  
      static java.lang.String CARTON  
      static java.lang.String CASE  
      static java.lang.String PALLET  
      static java.lang.String ROLL  
      static java.lang.String SACK  
      static java.lang.String UNPACKAGED  
    • Constructor Summary

      Constructors 
      Constructor Description
      QuantityCode()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isValid​(java.lang.String code)
      The code list provided with the ZUGFeRD standard only lists twelve codes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QuantityCode

        public QuantityCode()
    • Method Detail

      • isValid

        public boolean isValid​(java.lang.String code)
        The code list provided with the ZUGFeRD standard only lists twelve codes. There are more codes available (in UNCL 7065). We won't check the presence of a code in UNCL 7065, but we'll check if the code consists of two letters and if it's uppercase.
        Specified by:
        isValid in class CodeValidation
        Parameters:
        code - the code to be tested
        Returns:
        true if the code has the correct format