Class MicroProps

  • All Implemented Interfaces:
    MicroPropsGenerator, java.lang.Cloneable

    public class MicroProps
    extends java.lang.Object
    implements java.lang.Cloneable, MicroPropsGenerator
    MicroProps is the first MicroPropsGenerator that should be should be called, producing an initialized MicroProps instance that will be passed on and modified throughout the rest of the chain of MicroPropsGenerator instances.
    • Field Detail

      • nsName

        public java.lang.String nsName
      • padding

        public Padder padding
      • grouping

        public Grouper grouping
      • useCurrency

        public boolean useCurrency
      • gender

        public java.lang.String gender
      • currencyAsDecimal

        public java.lang.String currencyAsDecimal
      • immutable

        private final boolean immutable
      • mixedMeasures

        public java.util.List<Measure> mixedMeasures
        Contains all the measures.
      • indexOfQuantity

        public int indexOfQuantity
        Points to quantity position, -1 if the position is not set yet.
      • exhausted

        private volatile boolean exhausted
    • Constructor Detail

      • MicroProps

        public MicroProps​(boolean immutable)
        Parameters:
        immutable - Whether this MicroProps should behave as an immutable after construction with respect to the quantity chain.
    • Method Detail

      • processQuantity

        public MicroProps processQuantity​(DecimalQuantity quantity)
        As MicroProps is the "base instance", this implementation of MircoPropsGenerator.processQuantity() just ensures that the output micros is correctly initialized.

        For the "safe" invocation of this function, micros must not be *this, such that a copy of the base instance is made. For the "unsafe" path, this function can be used only once, because the base MicroProps instance will be modified and thus not be available for re-use.

        Specified by:
        processQuantity in interface MicroPropsGenerator
        Parameters:
        quantity - The quantity for consideration and optional mutation.
        Returns:
        an initialized MicroProps instance.
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object