1 4 package com.tc.config.schema; 5 6 import org.apache.commons.lang.builder.EqualsBuilder; 7 import org.apache.commons.lang.builder.HashCodeBuilder; 8 9 import com.tc.config.schema.dynamic.ObjectArrayConfigItem; 10 import com.tc.util.Assert; 11 import com.tc.util.stringification.OurStringBuilder; 12 13 16 public interface L2ConfigForL1 { 17 18 public static class L2Data { 19 private final String host; 20 private final int dsoPort; 21 22 public L2Data(String host, int dsoPort) { 23 Assert.assertNotBlank(host); 24 this.host = host; 25 this.dsoPort = dsoPort; 26 } 27 28 public String host() { 29 return this.host; 30 } 31 32 public int dsoPort() { 33 return this.dsoPort; 34 } 35 36 public boolean equals(Object that) { 37 if (!(that instanceof L2Data)) return false; 38 L2Data thatData = (L2Data) that; 39 return new EqualsBuilder().append(this.host, thatData.host) 40 .append(this.dsoPort, thatData.dsoPort).isEquals(); 41 } 42 43 public int hashCode() { 44 return new HashCodeBuilder().append(this.host).append(this.dsoPort).toHashCode(); 45 } 46 47 public String toString() { 48 return new OurStringBuilder(this).append("host", this.host) 49 .append("DSO port", this.dsoPort).toString(); 50 } 51 } 52 53 ObjectArrayConfigItem l2Data(); 54 55 } 56 | Popular Tags |