/** * Check that 2 entries are of the same type. * * @param entry * @return <code>true</code> is the two type are the same, <code>false</code> otherwise. */ public boolean isSameType(DNSEntry entry) { return (entry != null) && (entry.getRecordType() == this.getRecordType()); }
/** * Check that 2 entries are of the same type. * * @param entry * @return <code>true</code> is the two type are the same, <code>false</code> otherwise. */ public boolean isSameType(DNSEntry entry) { return (entry != null) && (entry.getRecordType() == this.getRecordType()); }
/** * Check that 2 entries are of the same type. * * @param entry * @return <code>true</code> is the two type are the same, <code>false</code> otherwise. */ public boolean isSameType(DNSEntry entry) { return (entry != null) && (entry.getRecordType() == this.getRecordType()); }
/** * Check that 2 entries are of the same type. * * @param entry * @return <code>true</code> is the two type are the same, <code>false</code> otherwise. */ public boolean isSameType(DNSEntry entry) { return (entry != null) && (entry.getRecordType() == this.getRecordType()); }
/** * Check if the requested record tyep match the current record type * * @param recordType * @return <code>true</code> if the two entries have compatible type, <code>false</code> otherwise */ public boolean matchRecordType(DNSRecordType recordType) { return this.getRecordType().equals(recordType); }
@Override public String toString() { StringBuilder aLog = new StringBuilder(200); aLog.append("[" + this.getClass().getSimpleName() + "@" + System.identityHashCode(this)); aLog.append(" type: " + this.getRecordType()); aLog.append(", class: " + this.getRecordClass()); aLog.append((_unique ? "-unique," : ",")); aLog.append(" name: " + _name); this.toString(aLog); aLog.append("]"); return aLog.toString(); }
@Override public String toString() { StringBuilder aLog = new StringBuilder(200); aLog.append("[" + this.getClass().getSimpleName() + "@" + System.identityHashCode(this)); aLog.append(" type: " + this.getRecordType()); aLog.append(", class: " + this.getRecordClass()); aLog.append((_unique ? "-unique," : ",")); aLog.append(" name: " + _name); this.toString(aLog); aLog.append("]"); return aLog.toString(); }
@Override public String toString() { StringBuilder aLog = new StringBuilder(200); aLog.append("[" + this.getClass().getSimpleName() + "@" + System.identityHashCode(this)); aLog.append(" type: " + this.getRecordType()); aLog.append(", class: " + this.getRecordClass()); aLog.append((_unique ? "-unique," : ",")); aLog.append(" name: " + _name); this.toString(aLog); aLog.append("]"); return aLog.toString(); }
/** * @param dout * @exception IOException */ protected void toByteArray(DataOutputStream dout) throws IOException { dout.write(this.getName().getBytes("UTF8")); dout.writeShort(this.getRecordType().indexValue()); dout.writeShort(this.getRecordClass().indexValue()); }
/** * @param dout * @exception IOException */ protected void toByteArray(DataOutputStream dout) throws IOException { dout.write(this.getName().getBytes("UTF8")); dout.writeShort(this.getRecordType().indexValue()); dout.writeShort(this.getRecordClass().indexValue()); }
@Override public boolean equals(Object obj) { boolean result = false; if (obj instanceof DNSEntry) { DNSEntry other = (DNSEntry) obj; result = this.getKey().equals(other.getKey()) && this.getRecordType().equals(other.getRecordType()) && this.getRecordClass() == other.getRecordClass(); } return result; }
/** * @param dout * @exception IOException */ protected void toByteArray(DataOutputStream dout) throws IOException { dout.write(this.getName().getBytes("UTF8")); dout.writeShort(this.getRecordType().indexValue()); dout.writeShort(this.getRecordClass().indexValue()); }
@Override public boolean equals(Object obj) { boolean result = false; if (obj instanceof DNSEntry) { DNSEntry other = (DNSEntry) obj; result = this.getKey().equals(other.getKey()) && this.getRecordType().equals(other.getRecordType()) && this.getRecordClass() == other.getRecordClass(); } return result; }
/** * Overriden, to return a value which is consistent with the value returned by equals(Object). */ @Override public int hashCode() { return this.getKey().hashCode() + this.getRecordType().indexValue() + this.getRecordClass().indexValue(); }
/** * Overriden, to return a value which is consistent with the value returned by equals(Object). */ @Override public int hashCode() { return this.getKey().hashCode() + this.getRecordType().indexValue() + this.getRecordClass().indexValue(); }
/** * Check if two entries have exactly the same name, type, and class. * * @param entry * @return <code>true</code> if the two entries have are for the same record, <code>false</code> otherwise */ public boolean isSameEntry(DNSEntry entry) { return this.getKey().equals(entry.getKey()) && this.getRecordType().equals(entry.getRecordType()) && ((DNSRecordClass.CLASS_ANY == entry.getRecordClass()) || this.getRecordClass().equals(entry.getRecordClass())); }
/** * Overriden, to return a value which is consistent with the value returned by equals(Object). */ @Override public int hashCode() { return this.getKey().hashCode() + this.getRecordType().indexValue() + this.getRecordClass().indexValue(); }
/** * Overriden, to return a value which is consistent with the value returned by equals(Object). */ @Override public int hashCode() { return this.getKey().hashCode() + this.getRecordType().indexValue() + this.getRecordClass().indexValue(); }
/** * Check if two entries have exactly the same name, type, and class. * * @param entry * @return <code>true</code> if the two entries have are for the same record, <code>false</code> otherwise */ public boolean isSameEntry(DNSEntry entry) { return this.getKey().equals(entry.getKey()) && this.getRecordType().equals(entry.getRecordType()) && ((DNSRecordClass.CLASS_ANY == entry.getRecordClass()) || this.getRecordClass().equals(entry.getRecordClass())); }
/** * Check if two entries have exactly the same name, type, and class. * * @param entry * @return <code>true</code> if the two entries have are for the same record, <code>false</code> otherwise */ public boolean isSameEntry(DNSEntry entry) { return this.getKey().equals(entry.getKey()) && this.matchRecordType(entry.getRecordType()) && this.matchRecordClass(entry.getRecordClass()); }