Package org.xbill.DNS

Class TXTRecord

java.lang.Object
org.xbill.DNS.Record
org.xbill.DNS.TXTRecord
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Record>

public class TXTRecord extends Record
Text - stores text strings
Author:
Brian Wellington
See Also:
  • Field Details

    • strings

      protected List<byte[]> strings
  • Constructor Details

    • TXTRecord

      public TXTRecord(Name name, int dclass, long ttl, List<String> strings)
      Creates a TXT Record from the given data
      Parameters:
      strings - The text strings
      Throws:
      IllegalArgumentException - One of the strings has invalid escapes
    • TXTRecord

      public TXTRecord(Name name, int dclass, long ttl, String string)
      Creates a TXT Record from the given data
      Parameters:
      string - One text string
      Throws:
      IllegalArgumentException - The string has invalid escapes
  • Method Details

    • rrFromWire

      protected void rrFromWire(DNSInput in) throws IOException
      Description copied from class: Record
      Converts the type-specific RR to wire format - must be overridden
      Specified by:
      rrFromWire in class Record
      Throws:
      IOException
    • rdataFromString

      protected void rdataFromString(Tokenizer st, Name origin) throws IOException
      Description copied from class: Record
      Converts the text format of an RR to the internal format - must be overriden
      Specified by:
      rdataFromString in class Record
      Throws:
      IOException
    • rrToString

      protected String rrToString()
      converts to a String
      Specified by:
      rrToString in class Record
    • getStrings

      public List<String> getStrings()
      Returns the text strings
      Returns:
      A list of Strings corresponding to the text strings.
    • getStringsAsByteArrays

      public List<byte[]> getStringsAsByteArrays()
      Returns the text strings
      Returns:
      A list of byte arrays corresponding to the text strings.
    • rrToWire

      protected void rrToWire(DNSOutput out, Compression c, boolean canonical)
      Description copied from class: Record
      Converts the type-specific RR to wire format - must be overridden.
      Specified by:
      rrToWire in class Record