@Test public void convertToString() { Boolean t = Boolean.TRUE; Boolean f = Boolean.FALSE; String s = converter.toString(t, null, null); assertNotNull(s); assertTrue("true".equals(s)); s = converter.toString(f, null, null); assertNotNull(s); assertTrue("false".equals(s)); }
@AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.STRING, concerns = { AtlasConversionConcern.CONVENTION }) public String toString(Boolean value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String format = targetFormat != null && !"".equals(targetFormat) ? targetFormat : STRING_VALUES; String[] values = format.split("\\|"); String trueValue = ""; String falseValue = ""; if (values.length == 2) { trueValue = values[0]; falseValue = values[1]; } else if (values.length == 1) { trueValue = values[0]; } return String.valueOf((value ? trueValue : falseValue)); }
BooleanConverter implements AtlasConverter<Boolean> { @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.STRING, concerns = { AtlasConversionConcern.CONVENTION }) public String toString(Boolean value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String format = targetFormat != null && !"".equals(targetFormat) ? targetFormat : STRING_VALUES; String[] values = format.split("\\|"); String trueValue = ""; String falseValue = ""; if (values.length == 2) { trueValue = values[0]; falseValue = values[1]; } else if (values.length == 1) { trueValue = values[0]; } return String.valueOf((value ? trueValue : falseValue)); } }
BooleanConverter implements AtlasConverter<Boolean> { @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.STRING, concerns = { AtlasConversionConcern.CONVENTION }) public String toString(Boolean value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String format = targetFormat != null && !"".equals(targetFormat) ? targetFormat : STRING_VALUES; String[] values = format.split("\\|"); String trueValue = ""; String falseValue = ""; if (values.length == 2) { trueValue = values[0]; falseValue = values[1]; } else if (values.length == 1) { trueValue = values[0]; } return String.valueOf((value ? trueValue : falseValue)); }  }
BooleanConverter implements AtlasConverter<Boolean> { @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.STRING, concerns = { AtlasConversionConcern.CONVENTION }) public String toString(Boolean value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String format = targetFormat != null && !"".equals(targetFormat) ? targetFormat : STRING_VALUES; String[] values = format.split("\\|"); String trueValue = ""; String falseValue = ""; if (values.length == 2) { trueValue = values[0]; falseValue = values[1]; } else if (values.length == 1) { trueValue = values[0]; } return String.valueOf((value ? trueValue : falseValue)); }  @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.DECIMAL) BigDecimal toBigDecimal(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.BIG_INTEGER) BigInteger toBigInteger(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.BOOLEAN) Boolean toBoolean(Boolean value, String sourceFormat, String targetFormat); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.BYTE) Byte toByte(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.CHAR) Character toCharacter(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.DOUBLE) Double toDouble(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.FLOAT) Float toFloat(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.INTEGER) Integer toInteger(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.LONG) Long toLong(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.NUMBER) Number toNumber(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.SHORT) Short toShort(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.STRING, concerns = { AtlasConversionConcern.CONVENTION }) String toString(Boolean value, String sourceFormat, String targetFormat); }
BooleanConverter implements AtlasConverter<Boolean> { @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.STRING, concerns = { AtlasConversionConcern.CONVENTION }) public String toString(Boolean value, String sourceFormat, String targetFormat) { if (value == null) { return null; } String format = targetFormat != null && !"".equals(targetFormat) ? targetFormat : STRING_VALUES; String[] values = format.split("\\|"); String trueValue = ""; String falseValue = ""; if (values.length == 2) { trueValue = values[0]; falseValue = values[1]; } else if (values.length == 1) { trueValue = values[0]; } return String.valueOf((value ? trueValue : falseValue)); }  @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.DECIMAL) BigDecimal toBigDecimal(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.BIG_INTEGER) BigInteger toBigInteger(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.BOOLEAN) Boolean toBoolean(Boolean value, String sourceFormat, String targetFormat); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.BYTE) Byte toByte(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.CHAR) Character toCharacter(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.DOUBLE) Double toDouble(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.FLOAT) Float toFloat(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.INTEGER) Integer toInteger(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.LONG) Long toLong(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.NUMBER) Number toNumber(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.SHORT) Short toShort(Boolean value); @AtlasConversionInfo(sourceType = FieldType.BOOLEAN, targetType = FieldType.STRING, concerns = { AtlasConversionConcern.CONVENTION }) String toString(Boolean value, String sourceFormat, String targetFormat);  }