class AmqpTarget implements PublishTarget {

    static AmqpTarget fromTargetAddress(final String targetAddress) {
        ConditionChecker.argumentNotEmpty(targetAddress, "targetAddress");
        final Destination destination;
        if (targetAddress.startsWith(TOPIC_PREFIX)) {
            destination = new JmsTopic(targetAddress.replace(TOPIC_PREFIX, EMPTY_STRING));
        } else if (targetAddress.startsWith(QUEUE_PREFIX)) {
            destination = new JmsQueue(targetAddress.replace(QUEUE_PREFIX, EMPTY_STRING));
        } else {
            destination = new JmsQueue(targetAddress);
        }
        return new AmqpTarget(destination);
    }

    private  AmqpTarget(final Destination jmsDestination);

}