Class Workarounds.OptionalParameterValue

  • Enclosing class:
    Workarounds

    public static final class Workarounds.OptionalParameterValue
    extends Object
    For https://issues.ametys.org/browse/CMS-9541
    When fixed, remove this class.
    What is happening is that currently, Ametys cannot see the difference between an empty value for an optional parameter (not present in purpose) and the absence of the value because it is a 'new' parameter (user never had the opportunity to fill it).
    Thus, as the optional parameter defines a default value, when editing the service, the default value is automatically filled for those parameters which are empty whereas we do not want.
    • Method Detail

      • isNotEmpty

        public static final boolean isNotEmpty​(Integer value)
        Returns true if the value is considered non-empty.
        Because of the workaround, 0 actually means "empty"
        Parameters:
        value - The value got from the storage
        Returns:
        true if the value is considered non-empty