public boolean doesOperatorAcceptValueList(ConditionCol52 c) { String operator = c.getOperator(); if (operator == null || operator.equals("")) { return false; } return !(operator.equals("== null") || operator.equals("!= null")); }
public boolean doesOperatorAcceptCommaSeparatedValues(ConditionCol52 c) { final List<String> ops = Arrays.asList(OperatorsOracle.EXPLICIT_LIST_OPERATORS); return ops.contains(c.getOperator()); }
public boolean doesOperatorAcceptCommaSeparatedValues(ConditionCol52 c) { final List<String> ops = Arrays.asList(OperatorsOracle.EXPLICIT_LIST_OPERATORS); return ops.contains(c.getOperator()); }
public boolean isConditionOperatorValid(ConditionCol52 c) { if (c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE) { return true; } return !(c.getOperator() == null || c.getOperator().equals("")); }
public boolean doesOperatorNeedValue(ConditionCol52 c) { String operator = c.getOperator(); if (operator == null || operator.equals("")) { return false; } return !(operator.equals("== null") || operator.equals("!= null")); }
public boolean doesOperatorAcceptValueList(ConditionCol52 c) { String operator = c.getOperator(); if (operator == null || operator.equals("")) { return false; } return !(operator.equals("== null") || operator.equals("!= null")); }
public boolean isConditionOperatorValid(ConditionCol52 c) { if (c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE) { return true; } return !(c.getOperator() == null || c.getOperator().equals("")); }
public boolean doesOperatorNeedValue(ConditionCol52 c) { String operator = c.getOperator(); if (operator == null || operator.equals("")) { return false; } return !(operator.equals("== null") || operator.equals("!= null")); }
public ConditionColumnDetails( final ConditionCol52 column ) { super( column ); this.factField = column.getFactField(); this.operator = column.getOperator(); }
private boolean canAcceptCommaSeparatedValues(final ConditionCol52 column) { //Check column contains literal values if (column.getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { return false; } //Check operator is supported final List<String> ops = Arrays.asList(OperatorsOracle.EXPLICIT_LIST_OPERATORS); return ops.contains(column.getOperator()); }
private boolean isConditionColumnWithSpecialOperator(final BaseColumn baseColumn) { return baseColumn instanceof ConditionCol52 && NullEqualityOperator.contains(((ConditionCol52) baseColumn).getOperator()); }
private boolean canAcceptCommaSeparatedValues(final ConditionCol52 column) { //Check column contains literal values if (column.getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { return false; } //Check operator is supported final List<String> ops = Arrays.asList(OperatorsOracle.EXPLICIT_LIST_OPERATORS); return ops.contains(column.getOperator()); }
private boolean isConditionColumnWithSpecialOperator(final BaseColumn baseColumn) { return baseColumn instanceof ConditionCol52 && NullEqualityOperator.contains(((ConditionCol52) baseColumn).getOperator()); }
/** * Retrieve the correct OtherwiseBuilder for the given column * @param c * @return */ public static OtherwiseBuilder getBuilder( ConditionCol52 c ) { if ( c.getOperator().equals( "==" ) ) { return new EqualsOtherwiseBuilder(); } else if ( c.getOperator().equals( "!=" ) ) { return new NotEqualsOtherwiseBuilder(); } throw new IllegalArgumentException( "ConditionCol operator does not support Otherwise values" ); }
public String getOperator() { return editingCol().getOperator(); }
private Condition buildCondition(final Field field) throws BuildException { try { final Column column = getColumn(); return new FieldCondition(field, column, resolveOperator(conditionCol52.getOperator()), resolveValues(conditionCol52.getOperator()), configuration); } catch (final BuildException e) { throw e; } catch (final Exception e) { throw new BuildException("Failed to build FieldCondition "); } }
@Test public void testGetOperator() { final String expectedOperator = "operator"; when(plugin.getFactField()).thenReturn("factField"); when(plugin.editingCol()).thenReturn(editingCol); when(editingCol.getOperator()).thenReturn(expectedOperator); final String operator = page.getOperator(); verify(plugin).editingCol(); verify(editingCol).getOperator(); assertEquals(expectedOperator, operator); }
@Test public void testIsCompleteWhenFactFieldIsNull() { when(editingCol.getOperator()).thenReturn("operator"); when(plugin.getFactField()).thenReturn(null); page.isComplete(Assert::assertFalse); verify(view).showOperatorWarning(); verify(view, never()).hideOperatorWarning(); }
@Test public void testIsCompleteWhenOperatorIsNotSelected() { final String operatorPlaceholder = "--- please choose ---"; when(plugin.operatorPlaceholder()).thenReturn(operatorPlaceholder); when(editingCol.getOperator()).thenReturn(operatorPlaceholder); when(plugin.getFactField()).thenReturn("factType"); page.isComplete(Assert::assertFalse); verify(view).showOperatorWarning(); verify(view, never()).hideOperatorWarning(); }
@Test public void testIsCompleteWhenFactFieldAndOperatorAreNotNull() { final String operatorPlaceholder = "--- please choose ---"; when(plugin.operatorPlaceholder()).thenReturn(operatorPlaceholder); when(editingCol.getOperator()).thenReturn("operator"); when(plugin.getFactField()).thenReturn("factType"); page.isComplete(Assert::assertTrue); verify(view, never()).showOperatorWarning(); verify(view).hideOperatorWarning(); }