Class Utils
- java.lang.Object
-
- com.vectorcast.plugins.vectorcastcoverage.portlet.utils.Utils
-
public final class Utils extends Object
Defines common methods that are used for the whole project.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalDate
calendarToLocalData(Calendar calendar)
Converts from Calendar type (jenkins job default) to java.time.LocalDat.static LocalDate
getLastDate(List<Job> jobs)
For the given list of jobs, this will search all jobs and return the last run date of all.static float
roundFLoat(int scale, int roundingMode, float value)
Method for rounding float values according to the requested mode.static int
validateChartAttributes(String attribute, int defaultValue)
Validate chart attributes returning a valid value to the object.
-
-
-
Method Detail
-
validateChartAttributes
public static int validateChartAttributes(String attribute, int defaultValue)
Validate chart attributes returning a valid value to the object.- Parameters:
attribute
- the attribute: width, height, number of daysdefaultValue
- default value for the attribute- Returns:
- int attribute valid value
-
getLastDate
public static LocalDate getLastDate(List<Job> jobs)
For the given list of jobs, this will search all jobs and return the last run date of all.- Parameters:
jobs
- a list of jobs from the DashBoard Portlet view- Returns:
- LocalDate the last date of all jobs that belogs to Dashboard View.
-
roundFLoat
public static float roundFLoat(int scale, int roundingMode, float value)
Method for rounding float values according to the requested mode.- Parameters:
scale
- the rounding scaleroundingMode
- the rounding direction @see java.math.RoundingModevalue
- the value to be rounded- Returns:
- the rounded value
-
-