class KafkaPublishTarget implements PublishTarget {

    static KafkaPublishTarget fromTargetAddress(final String targetAddress) {
        if (containsKey(targetAddress)) {
            return fromTargetAddressWithKey(targetAddress);
        } else if (containsPartition(targetAddress)) {
            return fromTargetAddressWithPartition(targetAddress);
        }

        return fromTargetAddressWithOnlyTopic(targetAddress);
    }

    private  KafkaPublishTarget(final String topic, @Nullable final String key, @Nullable final Integer partition);

}