1 /* 2 * hunt-amqp: AMQP library for D programming language, based on hunt-net. 3 * 4 * Copyright (C) 2018-2019 HuntLabs 5 * 6 * Website: https://www.huntlabs.net 7 * 8 * Licensed under the Apache-2.0 License. 9 * 10 */ 11 module hunt.amqp.streams.ProtonSubscriberOptions; 12 13 14 /** 15 * Options for configuring Subscriber attributes. 16 */ 17 class ProtonSubscriberOptions { 18 private string linkName; 19 20 this() { 21 } 22 23 /** 24 * Sets the link name to be used for the producer. 25 * 26 * @param linkName the name to use 27 * @return the options 28 */ 29 public ProtonSubscriberOptions setLinkName(string linkName) { 30 this.linkName = linkName; 31 return this; 32 } 33 34 public string getLinkName() { 35 return linkName; 36 } 37 38 override size_t toHash() @safe nothrow 39 { 40 int prime = 31; 41 42 int result = 1; 43 result = prime * result + cast(int)(linkName.hashOf); 44 45 return cast(size_t)result; 46 } 47 48 override 49 public bool opEquals(Object obj) { 50 if (this is obj) { 51 return true; 52 } 53 54 if (obj is null){ 55 return false; 56 } 57 58 ProtonSubscriberOptions other = cast(ProtonSubscriberOptions) obj; 59 if ((linkName != other.linkName)){ 60 return false; 61 } 62 63 return true; 64 } 65 }