/** * Converts a String representation of an Type into its numeric value. * * @param s The string representation of the type * @param numberok Whether a number will be accepted or not. * @return The type code, or -1 on error. */ public static int value(String s, boolean numberok) { int val = types.getValue(s); if (val == -1 && numberok) { val = types.getValue("TYPE" + s); } return val; }
static Record getProto(int val) { return types.getProto(val); }
/** * Converts a numeric Type into a String * * @param val The type value. * @return The canonical string representation of the type * @throws InvalidTypeException The type is out of range. */ public static String string(int val) { return types.getText(val); }
static { types.add(A, "A", new ARecord()); types.add(NS, "NS", new NSRecord()); types.add(MD, "MD", new MDRecord()); types.add(MF, "MF", new MFRecord()); types.add(CNAME, "CNAME", new CNAMERecord()); types.add(SOA, "SOA", new SOARecord()); types.add(MB, "MB", new MBRecord()); types.add(MG, "MG", new MGRecord()); types.add(MR, "MR", new MRRecord()); types.add(NULL, "NULL", new NULLRecord()); types.add(WKS, "WKS", new WKSRecord()); types.add(PTR, "PTR", new PTRRecord()); types.add(HINFO, "HINFO", new HINFORecord()); types.add(MINFO, "MINFO", new MINFORecord()); types.add(MX, "MX", new MXRecord()); types.add(TXT, "TXT", new TXTRecord()); types.add(RP, "RP", new RPRecord()); types.add(AFSDB, "AFSDB", new AFSDBRecord()); types.add(X25, "X25", new X25Record()); types.add(ISDN, "ISDN", new ISDNRecord()); types.add(RT, "RT", new RTRecord()); types.add(NSAP, "NSAP", new NSAPRecord()); types.add(NSAP_PTR, "NSAP-PTR", new NSAP_PTRRecord()); types.add(SIG, "SIG", new SIGRecord()); types.add(KEY, "KEY", new KEYRecord()); types.add(PX, "PX", new PXRecord()); types.add(GPOS, "GPOS", new GPOSRecord()); types.add(AAAA, "AAAA", new AAAARecord()); types.add(LOC, "LOC", new LOCRecord()); types.add(NXT, "NXT", new NXTRecord()); types.add(EID, "EID"); types.add(NIMLOC, "NIMLOC"); types.add(SRV, "SRV", new SRVRecord()); types.add(ATMA, "ATMA"); types.add(NAPTR, "NAPTR", new NAPTRRecord()); types.add(KX, "KX", new KXRecord()); types.add(CERT, "CERT", new CERTRecord()); types.add(A6, "A6", new A6Record()); types.add(DNAME, "DNAME", new DNAMERecord()); types.add(OPT, "OPT", new OPTRecord()); types.add(APL, "APL", new APLRecord()); types.add(DS, "DS", new DSRecord()); types.add(SSHFP, "SSHFP", new SSHFPRecord()); types.add(IPSECKEY, "IPSECKEY", new IPSECKEYRecord()); types.add(RRSIG, "RRSIG", new RRSIGRecord()); types.add(NSEC, "NSEC", new NSECRecord()); types.add(DNSKEY, "DNSKEY", new DNSKEYRecord()); types.add(DHCID, "DHCID", new DHCIDRecord()); types.add(NSEC3, "NSEC3", new NSEC3Record()); types.add(NSEC3PARAM, "NSEC3PARAM", new NSEC3PARAMRecord()); types.add(TLSA, "TLSA", new TLSARecord()); types.add(SPF, "SPF", new SPFRecord()); types.add(TKEY, "TKEY", new TKEYRecord()); types.add(TSIG, "TSIG", new TSIGRecord()); types.add(IXFR, "IXFR"); types.add(AXFR, "AXFR"); types.add(MAILB, "MAILB"); types.add(MAILA, "MAILA"); types.add(ANY, "ANY"); types.add(URI, "URI", new URIRecord()); types.add(DLV, "DLV", new DLVRecord()); }