|
What this is
Other links
The source code// $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testelement/property/TestElementProperty.java,v 1.15 2004/02/21 21:59:37 sebb Exp $ /* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.testelement.property; import org.apache.jmeter.testelement.TestElement; /** * @version $Revision: 1.15 $ */ public class TestElementProperty extends MultiProperty { TestElement value; TestElement savedValue = null; public TestElementProperty(String name, TestElement value) { super(name); this.value = value; } public TestElementProperty() { super(); } /** * Determines if two test elements are equal. * * @return true if the value is not null and equals the other Objects value; * false otherwise (even if both values are null) */ public boolean equals(Object o) { if (o instanceof TestElementProperty) { if (this == o) return true; if (value != null) { return value.equals(((JMeterProperty) o).getObjectValue()); } } return false; } public int hashCode() { return value == null ? 0 : value.hashCode(); } /* (non-Javadoc) * #getStringValue() */ public String getStringValue() { return value.toString(); } public void setObjectValue(Object v) { if (v instanceof TestElement) { value = (TestElement) v; } } /* (non-Javadoc) * #getObjectValue() */ public Object getObjectValue() { return value; } public TestElement getElement() { return value; } public void setElement(TestElement el) { value = el; } /* (non-Javadoc) * @see java.lang.Object#clone() */ public Object clone() { TestElementProperty prop = (TestElementProperty) super.clone(); prop.value = (TestElement) value.clone(); return prop; } /* (non-Javadoc) * #mergeIn(JMeterProperty) */ public void mergeIn(JMeterProperty prop) { if (isEqualType(prop)) { value.addTestElement((TestElement) prop.getObjectValue()); } } /* (non-Javadoc) * #recoverRunningVersion(TestElement) */ public void recoverRunningVersion(TestElement owner) { if (savedValue != null) { value = savedValue; } value.recoverRunningVersion(); } /* (non-Javadoc) * #setRunningVersion(boolean) */ public void setRunningVersion(boolean runningVersion) { super.setRunningVersion(runningVersion); value.setRunningVersion(runningVersion); if(runningVersion) { savedValue = value; } else { savedValue = null; } } /* (non-Javadoc) * @see MultiProperty#addProperty(JMeterProperty) */ public void addProperty(JMeterProperty prop) { value.setProperty(prop); } /* (non-Javadoc) * @see MultiProperty#clear() */ public void clear() { value.clear(); } /* (non-Javadoc) * @see MultiProperty#iterator() */ public PropertyIterator iterator() { return value.propertyIterator(); } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.