private void setRecord(int section, DnsRecord record) { clear(section); setSection(section, checkQuestion(section, record)); }
private <T extends DnsRecord> T setRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { throw new IndexOutOfBoundsException("index: " + index + " (expected: none)"); } if (records instanceof DnsRecord) { if (index == 0) { setSection(section, record); return castRecord(records); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; return castRecord(recordList.set(index, record)); }
private void setRecord(int section, DnsRecord record) { clear(section); setSection(section, checkQuestion(section, record)); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private <T extends DnsRecord> T setRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { throw new IndexOutOfBoundsException("index: " + index + " (expected: none)"); } if (records instanceof DnsRecord) { if (index == 0) { setSection(section, record); return castRecord(records); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; return castRecord(recordList.set(index, record)); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void setRecord(int section, DnsRecord record) { clear(section); setSection(section, checkQuestion(section, record)); }
private void setRecord(int section, DnsRecord record) { clear(section); setSection(section, checkQuestion(section, record)); }
private void setRecord(int section, DnsRecord record) { clear(section); setSection(section, checkQuestion(section, record)); }
private <T extends DnsRecord> T setRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { throw new IndexOutOfBoundsException("index: " + index + " (expected: none)"); } if (records instanceof DnsRecord) { if (index == 0) { setSection(section, record); return castRecord(records); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; return castRecord(recordList.set(index, record)); }
private <T extends DnsRecord> T setRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { throw new IndexOutOfBoundsException("index: " + index + " (expected: none)"); } if (records instanceof DnsRecord) { if (index == 0) { setSection(section, record); return castRecord(records); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; return castRecord(recordList.set(index, record)); }
private <T extends DnsRecord> T setRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { throw new IndexOutOfBoundsException("index: " + index + " (expected: none)"); } if (records instanceof DnsRecord) { if (index == 0) { setSection(section, record); return castRecord(records); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; return castRecord(recordList.set(index, record)); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }