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

Method value

src/main/java/core/org/xbill/DNS/KEYRecord.java:233–254  ·  view source on GitHub ↗

Converts a textual representation of KEY flags into its numeric code. Integers in the range 0..65535 are also accepted. @param s The textual representation of the protocol @return The protocol code, or -1 on error.

(String s)

Source from the content-addressed store, hash-verified

231 * @return The protocol code, or -1 on error.
232 */
233 public static int
234 value(String s) {
235 int value;
236 try {
237 value = Integer.parseInt(s);
238 if (value >= 0 && value <= 0xFFFF) {
239 return value;
240 }
241 return -1;
242 } catch (NumberFormatException e) {
243 }
244 StringTokenizer st = new StringTokenizer(s, "|");
245 value = 0;
246 while (st.hasMoreTokens()) {
247 int val = flags.getValue(st.nextToken());
248 if (val < 0) {
249 return -1;
250 }
251 value |= val;
252 }
253 return value;
254 }
255}
256
257/* flags */

Callers 1

rdataFromStringMethod · 0.95

Calls 1

getValueMethod · 0.45

Tested by

no test coverage detected