Clover Coverage Report - JmDNS 3.4.1
Coverage timestamp: Thu Aug 25 2011 13:06:33 CEST
../../../../img/srcFileCovDistChart2.png 70% of files have more coverage
10   78   6   2
2   31   0.6   5
5     1.2  
1    
 
  DNSOptionCode       Line # 11 10 0% 6 14 17.6% 0.1764706
 
  (1)
 
1    /**
2    *
3    */
4    package javax.jmdns.impl.constants;
5   
6    /**
7    * DNS option code.
8    *
9    * @author Arthur van Hoff, Pierre Frisch, Rick Blair
10    */
 
11    public enum DNSOptionCode {
12   
13    /**
14    * Token
15    */
16    Unknown("Unknown", 65535),
17    /**
18    * Long-Lived Queries Option [http://files.dns-sd.org/draft-sekar-dns-llq.txt]
19    */
20    LLQ("LLQ", 1),
21    /**
22    * Update Leases Option [http://files.dns-sd.org/draft-sekar-dns-ul.txt]
23    */
24    UL("UL", 2),
25    /**
26    * Name Server Identifier Option [RFC5001]
27    */
28    NSID("NSID", 3),
29    /**
30    * Owner Option [draft-cheshire-edns0-owner-option]
31    */
32    Owner("Owner", 4);
33   
34    private final String _externalName;
35   
36    private final int _index;
37   
 
38  5 toggle DNSOptionCode(String name, int index) {
39  5 _externalName = name;
40  5 _index = index;
41    }
42   
43    /**
44    * Return the string representation of this type
45    *
46    * @return String
47    */
 
48  0 toggle public String externalName() {
49  0 return _externalName;
50    }
51   
52    /**
53    * Return the numeric value of this type
54    *
55    * @return String
56    */
 
57  0 toggle public int indexValue() {
58  0 return _index;
59    }
60   
61    /**
62    * @param optioncode
63    * @return label
64    */
 
65  0 toggle public static DNSOptionCode resultCodeForFlags(int optioncode) {
66  0 int maskedIndex = optioncode;
67  0 for (DNSOptionCode aCode : DNSOptionCode.values()) {
68  0 if (aCode._index == maskedIndex) return aCode;
69    }
70  0 return Unknown;
71    }
72   
 
73  0 toggle @Override
74    public String toString() {
75  0 return this.name() + " index " + this.indexValue();
76    }
77   
78    }