Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7171 dpurdie 1
package com.erggroup.buildtool.ripple;
2
 
3
public class PlanControl {
4
    /**
5
     * Controls the selection between a basicPlan and a fullPlan
6
     *  <0 - Not expected. Treat as zero
7
     *   0 - Always execute the full plan
8
     *  >0 - Not sure yet
9
     */
10
    int mThreshold = 0;
11
 
12
    /**
13
     * Flag the the current (basicPlan) should be dumped
14
     * Once set the flag will be actioned and reset
15
     * 
16
     */
17
    boolean mDumpPlan = false;
18
 
19
    /**
20
     * Save a new plan threshold value with sanity testing
21
     * 
22
     * @param mustGetInt
23
     */
24
    public void setThreshold(int threshold) {
25
        if (threshold < 0)
26
            threshold = 0;
27
 
28
        mThreshold = threshold;  
29
    }
30
 
31
    /** Save the plan Dump flag with sanity testing
32
     * 
33
     * @param planDump - PlanDump value. Only the first character is valid. 'Y' == dump 
34
     */
35
    public void setDumpPlan(String planDump) {
36
        if (planDump != null)
37
        {
38
            mDumpPlan = (Character.toUpperCase(planDump.charAt(0)) == 'Y');
39
        }
40
    }
41
 
42
    /** Pretty diagnostic support
43
     * 
44
     */
45
    public String toString() {
46
        return "Threshold:" + mThreshold + " Dump:" + mDumpPlan;
47
    }
48
}