1   package us.blanshard.stubout.tests.model;
2   
3   /**
4    * A sample class that has various kinds of methods that can be replaced by the
5    * stubber.
6    * 
7    * @author Luke Blanshard
8    */
9   public class ModelClass
10  {
11      private static ModelClass instance;
12      
13      private String stringValue;
14      private int    intValue;
15      private double doubleValue;
16  
17      public ModelClass() {}
18      
19      public ModelClass( String s, int i, double d ) {
20          setStringValue(s);
21          setIntValue(i);
22          setDoubleValue(d);
23      }
24  
25      public double getDoubleValue() {
26          return doubleValue;
27      }
28      public void setDoubleValue( double doubleValue ) {
29          this.doubleValue = doubleValue;
30      }
31  
32      public int getIntValue() {
33          return intValue;
34      }
35      public void setIntValue( int intValue ) {
36          this.intValue = intValue;
37      }
38  
39      public String getStringValue() {
40          return stringValue;
41      }
42      public void setStringValue( String stringValue ) {
43          this.stringValue = stringValue;
44      }
45      
46      public static String concat( String s, int i, double d ) {
47          return s + i + d;
48      }
49      
50      public static void setInstance( String s, int i, double d ) {
51          setInstance( new ModelClass(s, i, d) );
52      }
53  
54      public static void setInstance( ModelClass mc ) {
55          instance = mc;
56      }
57  
58      public static ModelClass getInstance() {
59          return instance;
60      }
61      
62      public String toString() {
63          return concat( stringValue, intValue, doubleValue );
64      }
65  }