public static ValueType[] excluding( ValueType[] among, ValueType... exclude ) { return excluding( among, t -> ArrayUtils.contains( exclude, t ) ); }
/** * Create an array containing all value types, excluding provided types. */ public static ValueType[] excluding( ValueType... exclude ) { return excluding( ValueType.values(), exclude ); }
private ValueType[] supportedTypesExcludingNonOrderable() { return RandomValues.excluding( valueCreatorUtil.supportedTypes(), t -> t.valueGroup == ValueGroup.GEOMETRY || t.valueGroup == ValueGroup.GEOMETRY_ARRAY || t == ValueType.STRING || t == ValueType.STRING_ARRAY ); }
public ValueType[] supportedValueTypes() { if ( !supportsSpatial() ) { return RandomValues.excluding( ValueType.CARTESIAN_POINT, ValueType.CARTESIAN_POINT_ARRAY, ValueType.CARTESIAN_POINT_3D, ValueType.CARTESIAN_POINT_3D_ARRAY, ValueType.GEOGRAPHIC_POINT, ValueType.GEOGRAPHIC_POINT_ARRAY, ValueType.GEOGRAPHIC_POINT_3D, ValueType.GEOGRAPHIC_POINT_3D_ARRAY ); } return ValueType.values(); }
@Test public void excluding() { ValueType[] allTypes = ValueType.values(); ValueType[] excluding = randomValues.selection( allTypes, 1, allTypes.length, false ); ValueType[] including = randomValues.excluding( excluding ); for ( ValueType excludedType : excluding ) { if ( ArrayUtils.contains( including, excludedType ) ) { fail( "Including array " + Arrays.toString( including ) + " contains excluded type " + excludedType ); } } }
ValueType[] randomSetOfSupportedAndSortableTypes() { ValueType[] types = testSuite.supportedValueTypes(); types = removeSpatialTypes( types ); // <- don't use spatial values types = RandomValues.excluding( types, ValueType.STRING, ValueType.STRING_ARRAY ); // <- don't use strings outside of BMP types = random.randomValues().selection( types, 2, types.length, false ); return types; }
ValueType[] allExceptNonSortable = RandomValues.excluding( ValueType.STRING, ValueType.STRING_ARRAY );
ValueType[] allExceptNonOrderable = RandomValues.excluding( ValueType.STRING, ValueType.STRING_ARRAY,
public static ValueType[] excluding( ValueType[] among, ValueType... exclude ) { return excluding( among, t -> ArrayUtils.contains( exclude, t ) ); }
/** * Create an array containing all value types, excluding provided types. */ public static ValueType[] excluding( ValueType... exclude ) { return excluding( ValueType.values(), exclude ); }