public class RRset
extends java.lang.Object
implements java.io.Serializable
Record
,
RRSIGRecord
,
Serialized FormModifier and Type | Field and Description |
---|---|
private short |
position |
private java.util.ArrayList<Record> |
rrs |
private java.util.ArrayList<RRSIGRecord> |
sigs |
private long |
ttl |
Constructor and Description |
---|
RRset()
Creates an empty RRset
|
RRset(Record... records)
Creates an RRset and sets its contents to the specified record(s)
|
RRset(Record record)
Creates an RRset and sets its contents to the specified record
|
RRset(RRset rrset)
Creates an RRset with the contents of an existing RRset
|
Modifier and Type | Method and Description |
---|---|
void |
addRR(Record r)
Adds a Record to this RRset.
|
void |
addRR(RRSIGRecord r)
Adds a signature to this RRset.
|
private <X extends Record> |
addRR(X r,
java.util.List<X> rs) |
private <X extends Record> |
adjustTtl(long ttl,
java.util.List<X> rs) |
private void |
appendRrList(java.util.Iterator<? extends Record> it,
java.lang.StringBuilder sb) |
private void |
checkSameRRset(Record r,
java.util.List<? extends Record> rs) |
void |
clear()
Deletes all records (including signatures) from this RRset
|
void |
deleteRR(Record r)
Deletes a record from this RRset
|
void |
deleteRR(RRSIGRecord r)
Deletes a signature from this RRset
|
Record |
first()
Returns the first record in this RRset, either an RR or a signature.
|
int |
getDClass()
Returns the class of the records
|
Name |
getName()
Returns the name of the records
|
long |
getTTL()
Returns the ttl of the records
|
int |
getType()
Returns the type of the records
|
java.util.List<Record> |
rrs()
Returns a list of all data records.
|
java.util.List<Record> |
rrs(boolean cycle)
Returns a list of all data records.
|
java.util.List<RRSIGRecord> |
sigs()
Returns a list of all signature records.
|
int |
size()
Returns the number of (data) records
|
java.lang.String |
toString()
Converts the RRset to a String
|
private final java.util.ArrayList<Record> rrs
private final java.util.ArrayList<RRSIGRecord> sigs
private short position
private long ttl
public RRset()
public RRset(Record record)
public RRset(Record... records)
records
- The records to add to the set. See addRR(Record)
for restrictions.public RRset(RRset rrset)
public void addRR(RRSIGRecord r)
java.lang.IllegalArgumentException
- if the RRset already contains records and the signature to add
does not match.public void addRR(Record r)
java.lang.IllegalArgumentException
- if the RRset already contains records and the record to add
does not match.private <X extends Record> void addRR(X r, java.util.List<X> rs)
private <X extends Record> void adjustTtl(long ttl, java.util.List<X> rs)
public void deleteRR(RRSIGRecord r)
public void deleteRR(Record r)
public void clear()
public java.util.List<Record> rrs(boolean cycle)
cycle
- If true, cycle through the records so that each list will start with a different
record.public java.util.List<Record> rrs()
public java.util.List<RRSIGRecord> sigs()
public int size()
public int getType()
Type
public int getDClass()
DClass
public long getTTL()
public Record first()
java.lang.IllegalStateException
- if the RRset is emptyprivate void appendRrList(java.util.Iterator<? extends Record> it, java.lang.StringBuilder sb)
public java.lang.String toString()
toString
in class java.lang.Object