Class VariableScheduledValue

    • Constructor Detail

      • VariableScheduledValue

        protected VariableScheduledValue()
      • VariableScheduledValue

        public VariableScheduledValue​(String value,
                                      Period period)
        Constructs a new variable value to schedule at the specified period of time.
        Parameters:
        value - the value of a variable
        period - the period in time during which the value will be active.
    • Method Detail

      • getCurrentOnes

        public static List<VariableScheduledValue> getCurrentOnes()
        Gets all the variable scheduled values that are currently valid. If a variable has several values that are scheduled at the current date, only one of them is returned (the first found one).
        Returns:
        a list with the current scheduled variable values or an empty list if there is no variable values scheduled at the current date.
      • getPeriod

        public Period getPeriod()
        Gets the period in time during which this variable's value will be active.
        Returns:
        the period in time. The start date and the end date are expressed in LocalDate
      • getValue

        public String getValue()
        Gets the embedded value of this scheduled value.
        Returns:
        the value.
      • getVariable

        public Variable getVariable()
        Gets the variable this scheduled value belongs to.
        Returns:
        the variable that is valued by this value.
      • getValueForHTML

        public String getValueForHTML()
        Gets the value formatted in HTML.
        Returns:
        the HTML-formatted value.
      • merge

        public void merge​(VariableScheduledValue value)
        Merges this variable's value with the properties of the specified value.
        Parameters:
        value - a variable value from which the merge has to be done.
      • updateFrom

        public VariableScheduledValue updateFrom​(VariableScheduledValue newValue)
        Updates both the value and the period in time this value is valid of this variable value from the specified another variable value. Be cautious: the modification is automatically synchronized into the persistence context.
        Parameters:
        newValue - the new variable value to set.