hudson.plugins.violations
Class TypeConfig

java.lang.Object
  extended by hudson.plugins.violations.TypeConfig
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class TypeConfig
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This contains the configuration of a particular violation type.

See Also:
Serialized Form

Field Summary
static int DEFAULT_MAX
          Default max
static int DEFAULT_MIN
          Default min
 
Constructor Summary
TypeConfig(java.lang.String type)
          Construct a type config.
 
Method Summary
 TypeConfig clone()
          Clone the type config.
 void fix()
          Ensure that max is > min and that both are positive.
 int getHealthFor(int violations)
          A utility method to calculate the health percentage.
 int getMax()
          Get the max (stormy).
 int getMin()
          Get the min (sunny).
 java.lang.String getName()
          Return the type.
 java.lang.String getPattern()
          Get the fileset pattern.
 java.lang.String getType()
          Return the type.
 void setMax(int max)
          Set the max (stormy).
 void setMin(int min)
          Set the min (sunny).
 void setPattern(java.lang.String pattern)
          Set the fileset pattern.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MIN

public static final int DEFAULT_MIN
Default min

See Also:
Constant Field Values

DEFAULT_MAX

public static final int DEFAULT_MAX
Default max

See Also:
Constant Field Values
Constructor Detail

TypeConfig

public TypeConfig(java.lang.String type)
Construct a type config.

Parameters:
type - the type this config is for.
Method Detail

getType

public java.lang.String getType()
Return the type.

Returns:
the type.

getName

public java.lang.String getName()
Return the type.

Returns:
the type.

getMax

public int getMax()
Get the max (stormy).

Returns:
the lower limit for stormy.

setMax

public void setMax(int max)
Set the max (stormy).

Parameters:
max - the lower limit for stormy

getMin

public int getMin()
Get the min (sunny).

Returns:
the upper limit for sunny

setMin

public void setMin(int min)
Set the min (sunny).

Parameters:
min - the upper limit for sunny.

getPattern

public java.lang.String getPattern()
Get the fileset pattern.

Returns:
the pattern.

setPattern

public void setPattern(java.lang.String pattern)
Set the fileset pattern.

Parameters:
pattern - the fileset pattern.

fix

public void fix()
Ensure that max is > min and that both are positive.


getHealthFor

public int getHealthFor(int violations)
A utility method to calculate the health percentage.

Parameters:
violations - the number of violations.
Returns:
the percentage according to the thresholds.

clone

public TypeConfig clone()
Clone the type config.

Overrides:
clone in class java.lang.Object
Returns:
a cloned type config.


Copyright © 2008. All Rights Reserved.