hudson.plugins.emma.portlet.utils
Class Utils

java.lang.Object
  extended by hudson.plugins.emma.portlet.utils.Utils

public final class Utils
extends Object

Defines common methods that are used for the whole project.


Method Summary
static org.joda.time.LocalDate getLastDate(List<hudson.model.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 days
defaultValue - default value for the attribute
Returns:
int attribute valid value

getLastDate

public static org.joda.time.LocalDate getLastDate(List<hudson.model.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 scale
roundingMode - the rounding direction @see java.math.RoundingMode
value - the value to be rounded
Returns:
the rounded value


Copyright © 2004-2012 Hudson. All Rights Reserved.