Enum FormulaEvaluatorUtil

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FormulaEvaluatorUtil>

    public enum FormulaEvaluatorUtil
    extends java.lang.Enum<FormulaEvaluatorUtil>
    Provides methods that can be used in formula evaluation.

    Some code in formulas does not need to be generated again and again but is implemented in static methods in this class that are used by the formulas.

    Since:
    3.6
    See Also:
    IFormulaEvaluator
    • Method Detail

      • values

        public static FormulaEvaluatorUtil[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FormulaEvaluatorUtil c : FormulaEvaluatorUtil.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FormulaEvaluatorUtil valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getModelObjectById

        public static <T extends IModelObject,​R extends T> R getModelObjectById​(java.util.List<? extends T> modelObjects,
                                                                                      java.lang.String id)
        Returns the (first) IConfigurableModelObject in the list that is configured by a IProductComponent with the given ID, null if no such object is found in the list.
        Type Parameters:
        T - the type of IModelObject returned by this method and expected in the list
        Parameters:
        modelObjects - a list of model objects of type T
        id - the runtime ID this method searches
        Returns:
        the (first) IConfigurableModelObject in the list that is configured by a IProductComponent with the given ID, null if no such object is found in the list
        See Also:
        getModelObjectById(IModelObject, String)
      • getListModelObjectById

        public static <T extends IModelObject,​R extends T> java.util.List<? extends R> getListModelObjectById​(java.util.List<? extends T> modelObjects,
                                                                                                                    java.lang.String id)
        Returns all IConfigurableModelObject in the list that is configured by a IProductComponent with the given ID, the list is empty if no such object is found in the list.
        Type Parameters:
        T - the type of IModelObject returned by this method and expected in the list
        Parameters:
        modelObjects - a list of model objects of type T
        id - the runtime ID this method searches
        Returns:
        the all IConfigurableModelObject in the list that is configured by a IProductComponent with the given ID, the list is empty if no such object is found in the list
        See Also:
        getModelObjectById(IModelObject, String)
      • toPrimitiveBoolean

        public static boolean toPrimitiveBoolean​(java.lang.Boolean b)
        Returns the value of the Boolean object as a boolean primitive. If the Boolean object is null, false is returned.
        Returns:
        the primitive boolean value of the given Boolean.