1 18 19 package org.apache.jmeter.testelement.property; 20 21 import org.apache.jmeter.testelement.TestElement; 22 import org.apache.jorphan.util.JOrphanUtils; 23 24 27 public class BooleanProperty extends AbstractProperty 28 { 29 boolean value; boolean savedValue; 31 32 public BooleanProperty(String name,boolean v) 33 { 34 super(name); 35 value = v; 36 } 37 38 public BooleanProperty() 39 { 40 super(); 41 } 42 43 public void setObjectValue(Object v) 44 { 45 if(v instanceof Boolean ) 46 { 47 value = ((Boolean )v).booleanValue(); 48 } 49 else 50 { 51 value = Boolean.valueOf(v.toString()).booleanValue(); 52 } 53 } 54 55 58 public String getStringValue() 59 { 60 return JOrphanUtils.booleanToString(value); 61 } 62 63 66 public Object getObjectValue() 67 { 68 return JOrphanUtils.valueOf(value); 69 } 70 71 74 public Object clone() 75 { 76 BooleanProperty prop = (BooleanProperty)super.clone(); 77 prop.value = value; 78 return prop; 79 } 80 81 84 public boolean getBooleanValue() 85 { 86 return value; 87 } 88 91 public void setRunningVersion(boolean runningVersion) 92 { 93 savedValue = value; 94 super.setRunningVersion(runningVersion); 95 } 96 97 100 public void recoverRunningVersion(TestElement owner) 101 { 102 value = savedValue; 103 } 104 105 } 106 | Popular Tags |