MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / addRRset

Method addRRset

src/main/java/core/org/xbill/DNS/Zone.java:272–303  ·  view source on GitHub ↗
(Name name, RRset rrset)

Source from the content-addressed store, hash-verified

270}
271
272private synchronized void
273addRRset(Name name, RRset rrset) {
274 if (!hasWild && name.isWild())
275 hasWild = true;
276 Object types = data.get(name);
277 if (types == null) {
278 data.put(name, rrset);
279 return;
280 }
281 int rtype = rrset.getType();
282 if (types instanceof List) {
283 List list = (List) types;
284 for (int i = 0; i < list.size(); i++) {
285 RRset set = (RRset) list.get(i);
286 if (set.getType() == rtype) {
287 list.set(i, rrset);
288 return;
289 }
290 }
291 list.add(rrset);
292 } else {
293 RRset set = (RRset) types;
294 if (set.getType() == rtype)
295 data.put(name, rrset);
296 else {
297 LinkedList list = new LinkedList();
298 list.add(set);
299 list.add(rrset);
300 data.put(name, list);
301 }
302 }
303}
304
305private synchronized void
306removeRRset(Name name, int type) {

Callers 1

addRecordMethod · 0.95

Calls 9

getTypeMethod · 0.95
isWildMethod · 0.80
getTypeMethod · 0.65
getNameMethod · 0.65
getMethod · 0.45
putMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected