@Test public void testIsValidSerializationFormat_xml() throws SerializationException { boolean isValid = SerializerFactory.isValidSerializeFormat("xml"); Assert.assertTrue(isValid); }
public static boolean isValidSerializeFormat(final String serializeFormat) throws SerializationException { if (!StringUtils.hasText(serializeFormat)) { throw new SerializationException("serialization format is either null or empty!"); } else if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT) || serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { return true; } else { throw new SerializationException("Serializer not supported for the given serialization format : " + serializeFormat); } }
SerializerFactory { public static boolean isValidSerializeFormat(final String serializeFormat) throws SerializationException { if (!StringUtils.hasText(serializeFormat)) { throw new SerializationException("serialization format is either null or empty!"); } else if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT) || serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { return true; } else { throw new SerializationException("Serializer not supported for the given serialization format : " + serializeFormat); } } }
SerializerFactory { public static boolean isValidSerializeFormat(final String serializeFormat) throws SerializationException { if (!StringUtils.hasText(serializeFormat)) { throw new SerializationException("serialization format is either null or empty!"); } else if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT) || serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { return true; } else { throw new SerializationException("Serializer not supported for the given serialization format : " + serializeFormat); } } private  SerializerFactory(); }
SerializerFactory { public static boolean isValidSerializeFormat(final String serializeFormat) throws SerializationException { if (!StringUtils.hasText(serializeFormat)) { throw new SerializationException("serialization format is either null or empty!"); } else if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT) || serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { return true; } else { throw new SerializationException("Serializer not supported for the given serialization format : " + serializeFormat); } } private  SerializerFactory(); static SerializerFactory getInstance(); static IEntitySerializer getSerializer(final String serializeFormat); static boolean isValidSerializeFormat(final String serializeFormat); }
SerializerFactory { public static boolean isValidSerializeFormat(final String serializeFormat) throws SerializationException { if (!StringUtils.hasText(serializeFormat)) { throw new SerializationException("serialization format is either null or empty!"); } else if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT) || serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { return true; } else { throw new SerializationException("Serializer not supported for the given serialization format : " + serializeFormat); } } private  SerializerFactory(); static SerializerFactory getInstance(); static IEntitySerializer getSerializer(final String serializeFormat); static boolean isValidSerializeFormat(final String serializeFormat); static final String XML_SERIALIZE_FORMAT; static final String JSON_SERIALIZE_FORMAT; }