@Override public int hashCode() { int result = 1; result = 31 * result + name.hashCode(); result = 31 * result + type.hashCode(); result = 31 * result + (isTemp ? 1231 : 1237); return result; }
/** * An endpoint as specified in URI format: "type://name" * * @param destination the endpoint * @throws IllegalArgumentException invalid or null destination string */ public Endpoint(String destination) throws IllegalArgumentException { if (destination == null) { throw new IllegalArgumentException("destination must not be null"); } URI uri; try { uri = new URI(destination); } catch (Exception e) { throw new IllegalArgumentException("Not a valid destination URI: " + destination); } String typeStr = uri.getScheme().toUpperCase(); Type type; try { type = Type.valueOf(typeStr); } catch (Exception e) { throw new IllegalArgumentException("Not a valid destination URI [" + destination + "]; the endpoint type must be either QUEUE or TOPIC: " + typeStr); } String name = uri.getHost(); this.type = type; this.name = name; this.isTemp = false; }
/** * An endpoint as specified in URI format: "type://name" * * @param destination the endpoint * @throws IllegalArgumentException invalid or null destination string */ public Endpoint(String destination) throws IllegalArgumentException { if (destination == null) { throw new IllegalArgumentException("destination must not be null"); } URI uri; try { uri = new URI(destination); } catch (Exception e) { throw new IllegalArgumentException("Not a valid destination URI: " + destination); } String typeStr = uri.getScheme().toUpperCase(); Type type; try { type = Type.valueOf(typeStr); } catch (Exception e) { throw new IllegalArgumentException("Not a valid destination URI [" + destination + "]; the endpoint type must be either QUEUE or TOPIC: " + typeStr); } String name = uri.getHost(); this.type = type; this.name = name; this.isTemp = false; }
@Override public int hashCode() { int result = 1; result = 31 * result + name.hashCode(); result = 31 * result + type.hashCode(); result = 31 * result + (isTemp ? 1231 : 1237); return result; }