public void addFieldValue(final ActionFieldValue val) { if (val instanceof ActionFieldFunction) { super.addFieldValue(val); } else { throw new IllegalArgumentException( "Cannot assign field values of types other than ActionFieldFunction."); } } }
public void addFieldValue(final ActionFieldValue val) { if (val instanceof ActionFieldFunction) { super.addFieldValue(val); } else { throw new IllegalArgumentException( "Cannot assign field values of types other than ActionFieldFunction."); } } }
private ActionSetField visitActionFieldList(ActionSetField afl) { ActionSetField clone = new ActionSetField(); clone.variable = afl.variable; for ( ActionFieldValue afv : afl.fieldValues ) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField( afv.getField() ); afvClone.setNature( afv.getNature() ); afvClone.setType( afv.getType() ); afvClone.setValue( afv.getValue() ); clone.addFieldValue( afvClone ); } return clone; }
sf.getWorkItemResultParameterName(), sf.getParameterClassName() ); asf.addFieldValue( val );
private ActionSetField visitActionFieldList(ActionSetField afl) { ActionSetField clone = new ActionSetField(); clone.variable = afl.variable; for ( ActionFieldValue afv : afl.fieldValues ) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField( afv.getField() ); afvClone.setNature( afv.getNature() ); afvClone.setType( afv.getType() ); afvClone.setValue( afv.getValue() ); clone.addFieldValue( afvClone ); } return clone; }
sf.getWorkItemResultParameterName(), sf.getParameterClassName() ); asf.addFieldValue( val );
private void doAction(List<LabelledAction> actions, ActionSetFieldCol52 sf, String cell) { LabelledAction a = findByLabelledAction( actions, sf.getBoundName() ); if ( a == null ) { a = new LabelledAction(); a.boundName = sf.getBoundName(); if ( !sf.isUpdate() ) { a.action = new ActionSetField( sf.getBoundName() ); } else { a.action = new ActionUpdateField( sf.getBoundName() ); } actions.add( a ); } else if ( sf.isUpdate() && !(a.action instanceof ActionUpdateField) ) { // lets swap it out for an update as the user has asked for it. ActionSetField old = (ActionSetField) a.action; ActionUpdateField update = new ActionUpdateField( sf.getBoundName() ); update.fieldValues = old.fieldValues; a.action = update; } ActionSetField asf = (ActionSetField) a.action; ActionFieldValue val = new ActionFieldValue( sf.getFactField(), cell, sf.getType() ); asf.addFieldValue( val ); }
private void doAction(List<LabelledAction> actions, ActionSetFieldCol52 sf, String cell) { LabelledAction a = findByLabelledAction( actions, sf.getBoundName() ); if ( a == null ) { a = new LabelledAction(); a.boundName = sf.getBoundName(); if ( !sf.isUpdate() ) { a.action = new ActionSetField( sf.getBoundName() ); } else { a.action = new ActionUpdateField( sf.getBoundName() ); } actions.add( a ); } else if ( sf.isUpdate() && !(a.action instanceof ActionUpdateField) ) { // lets swap it out for an update as the user has asked for it. ActionSetField old = (ActionSetField) a.action; ActionUpdateField update = new ActionUpdateField( sf.getBoundName() ); update.fieldValues = old.fieldValues; a.action = update; } ActionSetField asf = (ActionSetField) a.action; ActionFieldValue val = new ActionFieldValue( sf.getFactField(), cell, sf.getType() ); asf.addFieldValue( val ); }
au.addFieldValue( new ActionFieldValue( "dob", "31-Jan-2000", SuggestionCompletionEngine.TYPE_DATE ) );
"BooleanResult", Boolean.class.getName() ); asf.addFieldValue( fv1 ); ActionWorkItemFieldValue fv2 = new ActionWorkItemFieldValue( "ResultsFloatResult", SuggestionCompletionEngine.TYPE_NUMERIC_FLOAT, "FloatResult", Float.class.getName() ); asf.addFieldValue( fv2 ); ActionWorkItemFieldValue fv3 = new ActionWorkItemFieldValue( "ResultsIntegerResult", SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER, "IntegerResult", Integer.class.getName() ); asf.addFieldValue( fv3 ); ActionWorkItemFieldValue fv4 = new ActionWorkItemFieldValue( "ResultsStringResult", SuggestionCompletionEngine.TYPE_STRING, "StringResult", String.class.getName() ); asf.addFieldValue( fv4 );
@Test public void testAdd() { final ActionSetField set = new ActionSetField(); set.fieldValues = new ActionFieldValue[2]; final ActionFieldValue v0 = new ActionFieldValue( "x", "42", SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER ); final ActionFieldValue v1 = new ActionFieldValue( "y", "43", SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER ); set.fieldValues[0] = v0; set.fieldValues[1] = v1; final ActionFieldValue q = new ActionFieldValue( "q", "q", SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER ); set.addFieldValue( q ); assertEquals( 3, set.fieldValues.length ); assertEquals( q, set.fieldValues[2] ); assertEquals( v0, set.fieldValues[0] ); }
SuggestionCompletionEngine.TYPE_STRING ); asf0f0.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE ); asf0.addFieldValue( asf0f0 ); ActionFieldValue asf0f1 = new ActionFieldValue( "ASF0F1", "ASF0F1Value", SuggestionCompletionEngine.TYPE_STRING ); asf0f1.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE ); asf0.addFieldValue( asf0f1 ); model.rhs[0] = asf0; SuggestionCompletionEngine.TYPE_STRING ); asf1f0.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE ); asf1.addFieldValue( asf1f0 ); ActionFieldValue asf1f1 = new ActionFieldValue( "ASF1F1", "ASF1F1Value", SuggestionCompletionEngine.TYPE_STRING ); asf1f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); asf1.addFieldValue( asf1f1 ); model.rhs[1] = asf1;
SuggestionCompletionEngine.TYPE_STRING ); asf0f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); asf0.addFieldValue( asf0f0 ); ActionFieldValue asf0f1 = new ActionFieldValue( "ASF0F1", "ASF0F1Value", SuggestionCompletionEngine.TYPE_STRING ); asf0f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); asf0.addFieldValue( asf0f1 ); model.rhs[0] = asf0; SuggestionCompletionEngine.TYPE_STRING ); asf1f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); asf1.addFieldValue( asf1f0 ); ActionFieldValue asf1f1 = new ActionFieldValue( "ASF1F1", "ASF1F1Value", SuggestionCompletionEngine.TYPE_STRING ); asf1f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); asf1.addFieldValue( asf1f1 ); model.rhs[1] = asf1;