}
return clone;
}
private PortableParameterDefinition cloneParameter(PortableParameterDefinition ppd) {
PortableParameterDefinition clone = null;
if ( ppd instanceof PortableBooleanParameterDefinition ) {
clone = new PortableBooleanParameterDefinition();
clone.setName( ppd.getName() );
((PortableBooleanParameterDefinition) clone).setBinding( ((PortableBooleanParameterDefinition) ppd).getBinding() );
((PortableBooleanParameterDefinition) clone).setValue( ((PortableBooleanParameterDefinition) ppd).getValue() );
return clone;
} else if ( ppd instanceof PortableEnumParameterDefinition ) {
clone = new PortableEnumParameterDefinition();
clone.setName( ppd.getName() );
((PortableEnumParameterDefinition) clone).setClassName( ((PortableEnumParameterDefinition) ppd).getClassName() );
((PortableEnumParameterDefinition) clone).setBinding( ((PortableEnumParameterDefinition) ppd).getBinding() );
((PortableEnumParameterDefinition) clone).setValues( ((PortableEnumParameterDefinition) ppd).getValues() );
((PortableEnumParameterDefinition) clone).setValue( ((PortableEnumParameterDefinition) ppd).getValue() );
return clone;
} else if ( ppd instanceof PortableFloatParameterDefinition ) {
clone = new PortableFloatParameterDefinition();
clone.setName( ppd.getName() );
((PortableFloatParameterDefinition) clone).setBinding( ((PortableFloatParameterDefinition) ppd).getBinding() );
((PortableFloatParameterDefinition) clone).setValue( ((PortableFloatParameterDefinition) ppd).getValue() );
return clone;
} else if ( ppd instanceof PortableIntegerParameterDefinition ) {
clone = new PortableIntegerParameterDefinition();
clone.setName( ppd.getName() );
((PortableIntegerParameterDefinition) clone).setBinding( ((PortableIntegerParameterDefinition) ppd).getBinding() );
((PortableIntegerParameterDefinition) clone).setValue( ((PortableIntegerParameterDefinition) ppd).getValue() );
return clone;
} else if ( ppd instanceof PortableListParameterDefinition ) {
clone = new PortableListParameterDefinition();
clone.setName( ppd.getName() );
((PortableListParameterDefinition) clone).setBinding( ((PortableListParameterDefinition) ppd).getBinding() );
((PortableListParameterDefinition) clone).setClassName( ((PortableListParameterDefinition) ppd).getClassName() );
return clone;
} else if ( ppd instanceof PortableObjectParameterDefinition ) {
clone = new PortableObjectParameterDefinition();
clone.setName( ppd.getName() );
((PortableObjectParameterDefinition) clone).setBinding( ((PortableObjectParameterDefinition) ppd).getBinding() );
((PortableObjectParameterDefinition) clone).setClassName( ((PortableObjectParameterDefinition) ppd).getClassName() );
return clone;
} else if ( ppd instanceof PortableStringParameterDefinition ) {
clone = new PortableStringParameterDefinition();
clone.setName( ppd.getName() );
((PortableStringParameterDefinition) clone).setBinding( ((PortableStringParameterDefinition) ppd).getBinding() );
((PortableStringParameterDefinition) clone).setValue( ((PortableStringParameterDefinition) ppd).getValue() );
return clone;
}
throw new IllegalArgumentException( "Unrecognized PortableParameterDefinition" );