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_FAIL
          Default fail
static int DEFAULT_MAX
          Default max
static int DEFAULT_MIN
          Default min
static int DEFAULT_UNSTABLE
          Default unstable
static int UNSTABLE_BLANK
          UNSTABLE BLANK
 
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.
 java.lang.Integer getFail()
          Get the fail value
 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.
 java.lang.Integer getUnstable()
          Get the unstable value
 boolean isUsePattern()
          Get the usePattern value.
 void setFail(java.lang.Integer fail)
          Set the fail value.
 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.
 void setUnstable(java.lang.Integer unstable)
          Set the unstable value.
 void setUsePattern(boolean usePattern)
          Set the usePattern value
 
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

DEFAULT_UNSTABLE

public static final int DEFAULT_UNSTABLE
Default unstable

See Also:
Constant Field Values

UNSTABLE_BLANK

public static final int UNSTABLE_BLANK
UNSTABLE BLANK

See Also:
Constant Field Values

DEFAULT_FAIL

public static final int DEFAULT_FAIL
Default fail

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.

getUnstable

public java.lang.Integer getUnstable()
Get the unstable value

Returns:
the unstable value

setUnstable

public void setUnstable(java.lang.Integer unstable)
Set the unstable value.

Parameters:
unstable - the value to use.

setFail

public void setFail(java.lang.Integer fail)
Set the fail value.

Parameters:
fail - the value to use.

getFail

public java.lang.Integer getFail()
Get the fail value

Returns:
the fail value

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.

setUsePattern

public void setUsePattern(boolean usePattern)
Set the usePattern value

Parameters:
usePattern - the value to use.

isUsePattern

public boolean isUsePattern()
Get the usePattern value.

Returns:
the usePattern value.

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 © 2004-2012. All Rights Reserved.