@Test public void convertToBooleanInvalid() { Character c = null; converter.toBoolean(c, null, null); assertNull(c); }
@AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BOOLEAN, concerns = { AtlasConversionConcern.CONVENTION }) public Boolean toBoolean(Character value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String regex = sourceFormat != null && !"".equals(sourceFormat) ? sourceFormat : TRUE_REGEX; if (Character.toString(value).matches(regex)) { return Boolean.TRUE; } return Boolean.FALSE; }
CharacterConverter implements AtlasConverter<Character> { @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BOOLEAN, concerns = { AtlasConversionConcern.CONVENTION }) public Boolean toBoolean(Character value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String regex = sourceFormat != null && !"".equals(sourceFormat) ? sourceFormat : TRUE_REGEX; if (Character.toString(value).matches(regex)) { return Boolean.TRUE; } return Boolean.FALSE; } }
CharacterConverter implements AtlasConverter<Character> { @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BOOLEAN, concerns = { AtlasConversionConcern.CONVENTION }) public Boolean toBoolean(Character value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String regex = sourceFormat != null && !"".equals(sourceFormat) ? sourceFormat : TRUE_REGEX; if (Character.toString(value).matches(regex)) { return Boolean.TRUE; } return Boolean.FALSE; }  }
CharacterConverter implements AtlasConverter<Character> { @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BOOLEAN, concerns = { AtlasConversionConcern.CONVENTION }) public Boolean toBoolean(Character value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String regex = sourceFormat != null && !"".equals(sourceFormat) ? sourceFormat : TRUE_REGEX; if (Character.toString(value).matches(regex)) { return Boolean.TRUE; } return Boolean.FALSE; }  @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.DECIMAL) BigDecimal toBigDecimal(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BIG_INTEGER) BigInteger toBigInteger(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BOOLEAN, concerns = { AtlasConversionConcern.CONVENTION }) Boolean toBoolean(Character value, String sourceFormat, String targetFormat); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BYTE, concerns = { AtlasConversionConcern.RANGE }) Byte toByte(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.CHAR) Character toCharacter(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.DOUBLE) Double toDouble(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.FLOAT) Float toFloat(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.INTEGER) Integer toInteger(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.LONG) Long toLong(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.NUMBER) Number toNumber(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.SHORT, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) Short toShort(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.STRING) String toString(Character value, String sourceFormat, String targetFormat); }
CharacterConverter implements AtlasConverter<Character> { @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BOOLEAN, concerns = { AtlasConversionConcern.CONVENTION }) public Boolean toBoolean(Character value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String regex = sourceFormat != null && !"".equals(sourceFormat) ? sourceFormat : TRUE_REGEX; if (Character.toString(value).matches(regex)) { return Boolean.TRUE; } return Boolean.FALSE; }  @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.DECIMAL) BigDecimal toBigDecimal(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BIG_INTEGER) BigInteger toBigInteger(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BOOLEAN, concerns = { AtlasConversionConcern.CONVENTION }) Boolean toBoolean(Character value, String sourceFormat, String targetFormat); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.BYTE, concerns = { AtlasConversionConcern.RANGE }) Byte toByte(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.CHAR) Character toCharacter(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.DOUBLE) Double toDouble(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.FLOAT) Float toFloat(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.INTEGER) Integer toInteger(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.LONG) Long toLong(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.NUMBER) Number toNumber(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.SHORT, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) Short toShort(Character value); @AtlasConversionInfo(sourceType = FieldType.CHAR, targetType = FieldType.STRING) String toString(Character value, String sourceFormat, String targetFormat);  }