/** * Check that 2 entries are of the same class. * * @param entry * @return <code>true</code> is the two class are the same, <code>false</code> otherwise. */ public boolean isSameRecordClass(DNSEntry entry) { return (entry != null) && (entry.getRecordClass() == this.getRecordClass()); }
/** * Check that 2 entries are of the same class. * * @param entry * @return <code>true</code> is the two class are the same, <code>false</code> otherwise. */ public boolean isSameRecordClass(DNSEntry entry) { return (entry != null) && (entry.getRecordClass() == this.getRecordClass()); }
/** * Check that 2 entries are of the same class. * * @param entry * @return <code>true</code> is the two class are the same, <code>false</code> otherwise. */ public boolean isSameRecordClass(DNSEntry entry) { return (entry != null) && (entry.getRecordClass() == this.getRecordClass()); }
/** * Check if the requested record class match the current record class * * @param recordClass * @return <code>true</code> if the two entries have compatible class, <code>false</code> otherwise */ public boolean matchRecordClass(DNSRecordClass recordClass) { return (DNSRecordClass.CLASS_ANY == recordClass) || (DNSRecordClass.CLASS_ANY == this.getRecordClass()) || this.getRecordClass().equals(recordClass); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(200); sb.append('[').append(this.getClass().getSimpleName()).append('@').append(System.identityHashCode(this)); sb.append(" type: ").append(this.getRecordType()); sb.append(", class: ").append(this.getRecordClass()); sb.append((_unique ? "-unique," : ",")); sb.append(" name: ").append( _name); this.toString(sb); sb.append(']'); return sb.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(); }
/** * 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())); }
/** * @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()); }
/** * @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; }
@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; }
@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; }
@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(); }
/** * 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.matchRecordType(entry.getRecordType()) && this.matchRecordClass(entry.getRecordClass()); }