repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
dnsjava/dnsjava
org/xbill/DNS/Mnemonic.java
Mnemonic.add
public void add(int val, String str) { check(val); Integer value = toInteger(val); str = sanitize(str); strings.put(str, value); values.put(value, str); }
java
public void add(int val, String str) { check(val); Integer value = toInteger(val); str = sanitize(str); strings.put(str, value); values.put(value, str); }
[ "public", "void", "add", "(", "int", "val", ",", "String", "str", ")", "{", "check", "(", "val", ")", ";", "Integer", "value", "=", "toInteger", "(", "val", ")", ";", "str", "=", "sanitize", "(", "str", ")", ";", "strings", ".", "put", "(", "str"...
Defines the text representation of a numeric value. @param val The numeric value @param string The text string
[ "Defines", "the", "text", "representation", "of", "a", "numeric", "value", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Mnemonic.java#L128-L135
train
dnsjava/dnsjava
org/xbill/DNS/Mnemonic.java
Mnemonic.addAll
public void addAll(Mnemonic source) { if (wordcase != source.wordcase) throw new IllegalArgumentException(source.description + ": wordcases do not match"); strings.putAll(source.strings); values.putAll(source.values); }
java
public void addAll(Mnemonic source) { if (wordcase != source.wordcase) throw new IllegalArgumentException(source.description + ": wordcases do not match"); strings.putAll(source.strings); values.putAll(source.values); }
[ "public", "void", "addAll", "(", "Mnemonic", "source", ")", "{", "if", "(", "wordcase", "!=", "source", ".", "wordcase", ")", "throw", "new", "IllegalArgumentException", "(", "source", ".", "description", "+", "\": wordcases do not match\"", ")", ";", "strings",...
Copies all mnemonics from one table into another. @param val The numeric value @param string The text string @throws IllegalArgumentException The wordcases of the Mnemonics do not match.
[ "Copies", "all", "mnemonics", "from", "one", "table", "into", "another", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Mnemonic.java#L158-L165
train
dnsjava/dnsjava
org/xbill/DNS/Mnemonic.java
Mnemonic.getText
public String getText(int val) { check(val); String str = (String) values.get(toInteger(val)); if (str != null) return str; str = Integer.toString(val); if (prefix != null) return prefix + str; return str; }
java
public String getText(int val) { check(val); String str = (String) values.get(toInteger(val)); if (str != null) return str; str = Integer.toString(val); if (prefix != null) return prefix + str; return str; }
[ "public", "String", "getText", "(", "int", "val", ")", "{", "check", "(", "val", ")", ";", "String", "str", "=", "(", "String", ")", "values", ".", "get", "(", "toInteger", "(", "val", ")", ")", ";", "if", "(", "str", "!=", "null", ")", "return",...
Gets the text mnemonic corresponding to a numeric value. @param val The numeric value @return The corresponding text mnemonic.
[ "Gets", "the", "text", "mnemonic", "corresponding", "to", "a", "numeric", "value", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Mnemonic.java#L172-L182
train
dnsjava/dnsjava
org/xbill/DNS/Mnemonic.java
Mnemonic.getValue
public int getValue(String str) { str = sanitize(str); Integer value = (Integer) strings.get(str); if (value != null) { return value.intValue(); } if (prefix != null) { if (str.startsWith(prefix)) { int val = parseNumeric(str.substring(prefix.length())); if (val >= 0) { return val; } } } if (n...
java
public int getValue(String str) { str = sanitize(str); Integer value = (Integer) strings.get(str); if (value != null) { return value.intValue(); } if (prefix != null) { if (str.startsWith(prefix)) { int val = parseNumeric(str.substring(prefix.length())); if (val >= 0) { return val; } } } if (n...
[ "public", "int", "getValue", "(", "String", "str", ")", "{", "str", "=", "sanitize", "(", "str", ")", ";", "Integer", "value", "=", "(", "Integer", ")", "strings", ".", "get", "(", "str", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "ret...
Gets the numeric value corresponding to a text mnemonic. @param str The text mnemonic @return The corresponding numeric value, or -1 if there is none
[ "Gets", "the", "numeric", "value", "corresponding", "to", "a", "text", "mnemonic", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Mnemonic.java#L189-L208
train
dnsjava/dnsjava
org/xbill/DNS/PXRecord.java
PXRecord.rrToString
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(preference); sb.append(" "); sb.append(map822); sb.append(" "); sb.append(mapX400); return sb.toString(); }
java
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(preference); sb.append(" "); sb.append(map822); sb.append(" "); sb.append(mapX400); return sb.toString(); }
[ "String", "rrToString", "(", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "preference", ")", ";", "sb", ".", "append", "(", "\" \"", ")", ";", "sb", ".", "append", "(", "map822", ")", ";", "sb...
Converts the PX Record to a String
[ "Converts", "the", "PX", "Record", "to", "a", "String" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/PXRecord.java#L60-L69
train
dnsjava/dnsjava
org/xbill/DNS/KEYBase.java
KEYBase.getPublicKey
public PublicKey getPublicKey() throws DNSSEC.DNSSECException { if (publicKey != null) return publicKey; publicKey = DNSSEC.toPublicKey(this); return publicKey; }
java
public PublicKey getPublicKey() throws DNSSEC.DNSSECException { if (publicKey != null) return publicKey; publicKey = DNSSEC.toPublicKey(this); return publicKey; }
[ "public", "PublicKey", "getPublicKey", "(", ")", "throws", "DNSSEC", ".", "DNSSECException", "{", "if", "(", "publicKey", "!=", "null", ")", "return", "publicKey", ";", "publicKey", "=", "DNSSEC", ".", "toPublicKey", "(", "this", ")", ";", "return", "publicK...
Returns a PublicKey corresponding to the data in this key. @throws DNSSEC.DNSSECException The key could not be converted.
[ "Returns", "a", "PublicKey", "corresponding", "to", "the", "data", "in", "this", "key", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/KEYBase.java#L143-L150
train
dnsjava/dnsjava
org/xbill/DNS/Cache.java
Cache.addRecord
public synchronized void addRecord(Record r, int cred, Object o) { Name name = r.getName(); int type = r.getRRsetType(); if (!Type.isRR(type)) return; Element element = findElement(name, type, cred); if (element == null) { CacheRRset crrset = new CacheRRset(r, cred, maxcache); addRRset(crrset, cred); } else...
java
public synchronized void addRecord(Record r, int cred, Object o) { Name name = r.getName(); int type = r.getRRsetType(); if (!Type.isRR(type)) return; Element element = findElement(name, type, cred); if (element == null) { CacheRRset crrset = new CacheRRset(r, cred, maxcache); addRRset(crrset, cred); } else...
[ "public", "synchronized", "void", "addRecord", "(", "Record", "r", ",", "int", "cred", ",", "Object", "o", ")", "{", "Name", "name", "=", "r", ".", "getName", "(", ")", ";", "int", "type", "=", "r", ".", "getRRsetType", "(", ")", ";", "if", "(", ...
Adds a record to the Cache. @param r The record to be added @param cred The credibility of the record @param o The source of the record (this could be a Message, for example) @see Record
[ "Adds", "a", "record", "to", "the", "Cache", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Cache.java#L326-L342
train
dnsjava/dnsjava
org/xbill/DNS/Cache.java
Cache.addRRset
public synchronized void addRRset(RRset rrset, int cred) { long ttl = rrset.getTTL(); Name name = rrset.getName(); int type = rrset.getType(); Element element = findElement(name, type, 0); if (ttl == 0) { if (element != null && element.compareCredibility(cred) <= 0) removeElement(name, type); } else { if (...
java
public synchronized void addRRset(RRset rrset, int cred) { long ttl = rrset.getTTL(); Name name = rrset.getName(); int type = rrset.getType(); Element element = findElement(name, type, 0); if (ttl == 0) { if (element != null && element.compareCredibility(cred) <= 0) removeElement(name, type); } else { if (...
[ "public", "synchronized", "void", "addRRset", "(", "RRset", "rrset", ",", "int", "cred", ")", "{", "long", "ttl", "=", "rrset", ".", "getTTL", "(", ")", ";", "Name", "name", "=", "rrset", ".", "getName", "(", ")", ";", "int", "type", "=", "rrset", ...
Adds an RRset to the Cache. @param rrset The RRset to be added @param cred The credibility of these records @see RRset
[ "Adds", "an", "RRset", "to", "the", "Cache", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Cache.java#L350-L371
train
dnsjava/dnsjava
org/xbill/DNS/Cache.java
Cache.addNegative
public synchronized void addNegative(Name name, int type, SOARecord soa, int cred) { long ttl = 0; if (soa != null) ttl = soa.getTTL(); Element element = findElement(name, type, 0); if (ttl == 0) { if (element != null && element.compareCredibility(cred) <= 0) removeElement(name, type); } else { if (elemen...
java
public synchronized void addNegative(Name name, int type, SOARecord soa, int cred) { long ttl = 0; if (soa != null) ttl = soa.getTTL(); Element element = findElement(name, type, 0); if (ttl == 0) { if (element != null && element.compareCredibility(cred) <= 0) removeElement(name, type); } else { if (elemen...
[ "public", "synchronized", "void", "addNegative", "(", "Name", "name", ",", "int", "type", ",", "SOARecord", "soa", ",", "int", "cred", ")", "{", "long", "ttl", "=", "0", ";", "if", "(", "soa", "!=", "null", ")", "ttl", "=", "soa", ".", "getTTL", "(...
Adds a negative entry to the Cache. @param name The name of the negative entry @param type The type of the negative entry @param soa The SOA record to add to the negative cache entry, or null. The negative cache ttl is derived from the SOA. @param cred The credibility of the negative entry
[ "Adds", "a", "negative", "entry", "to", "the", "Cache", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Cache.java#L381-L398
train
dnsjava/dnsjava
org/xbill/DNS/Cache.java
Cache.lookup
protected synchronized SetResponse lookup(Name name, int type, int minCred) { int labels; int tlabels; Element element; Name tname; Object types; SetResponse sr; labels = name.labels(); for (tlabels = labels; tlabels >= 1; tlabels--) { boolean isRoot = (tlabels == 1); boolean isExact = (tlabels == labels)...
java
protected synchronized SetResponse lookup(Name name, int type, int minCred) { int labels; int tlabels; Element element; Name tname; Object types; SetResponse sr; labels = name.labels(); for (tlabels = labels; tlabels >= 1; tlabels--) { boolean isRoot = (tlabels == 1); boolean isExact = (tlabels == labels)...
[ "protected", "synchronized", "SetResponse", "lookup", "(", "Name", "name", ",", "int", "type", ",", "int", "minCred", ")", "{", "int", "labels", ";", "int", "tlabels", ";", "Element", "element", ";", "Name", "tname", ";", "Object", "types", ";", "SetRespon...
Finds all matching sets or something that causes the lookup to stop.
[ "Finds", "all", "matching", "sets", "or", "something", "that", "causes", "the", "lookup", "to", "stop", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Cache.java#L403-L499
train
dnsjava/dnsjava
org/xbill/DNS/Cache.java
Cache.lookupRecords
public SetResponse lookupRecords(Name name, int type, int minCred) { return lookup(name, type, minCred); }
java
public SetResponse lookupRecords(Name name, int type, int minCred) { return lookup(name, type, minCred); }
[ "public", "SetResponse", "lookupRecords", "(", "Name", "name", ",", "int", "type", ",", "int", "minCred", ")", "{", "return", "lookup", "(", "name", ",", "type", ",", "minCred", ")", ";", "}" ]
Looks up Records in the Cache. This follows CNAMEs and handles negatively cached data. @param name The name to look up @param type The type to look up @param minCred The minimum acceptable credibility @return A SetResponse object @see SetResponse @see Credibility
[ "Looks", "up", "Records", "in", "the", "Cache", ".", "This", "follows", "CNAMEs", "and", "handles", "negatively", "cached", "data", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Cache.java#L511-L514
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getString
public String getString() throws IOException { Token next = get(); if (!next.isString()) { throw exception("expected a string"); } return next.value; }
java
public String getString() throws IOException { Token next = get(); if (!next.isString()) { throw exception("expected a string"); } return next.value; }
[ "public", "String", "getString", "(", ")", "throws", "IOException", "{", "Token", "next", "=", "get", "(", ")", ";", "if", "(", "!", "next", ".", "isString", "(", ")", ")", "{", "throw", "exception", "(", "\"expected a string\"", ")", ";", "}", "return...
Gets the next token from a tokenizer and converts it to a string. @return The next token in the stream, as a string. @throws TextParseException The input was invalid or not a string. @throws IOException An I/O error occurred.
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "converts", "it", "to", "a", "string", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L370-L377
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getLong
public long getLong() throws IOException { String next = _getIdentifier("an integer"); if (!Character.isDigit(next.charAt(0))) throw exception("expected an integer"); try { return Long.parseLong(next); } catch (NumberFormatException e) { throw exception("expected an integer"); } }
java
public long getLong() throws IOException { String next = _getIdentifier("an integer"); if (!Character.isDigit(next.charAt(0))) throw exception("expected an integer"); try { return Long.parseLong(next); } catch (NumberFormatException e) { throw exception("expected an integer"); } }
[ "public", "long", "getLong", "(", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"an integer\"", ")", ";", "if", "(", "!", "Character", ".", "isDigit", "(", "next", ".", "charAt", "(", "0", ")", ")", ")", "throw", "e...
Gets the next token from a tokenizer and converts it to a long. @return The next token in the stream, as a long. @throws TextParseException The input was invalid or not a long. @throws IOException An I/O error occurred.
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "converts", "it", "to", "a", "long", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L405-L415
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getTTL
public long getTTL() throws IOException { String next = _getIdentifier("a TTL value"); try { return TTL.parseTTL(next); } catch (NumberFormatException e) { throw exception("expected a TTL value"); } }
java
public long getTTL() throws IOException { String next = _getIdentifier("a TTL value"); try { return TTL.parseTTL(next); } catch (NumberFormatException e) { throw exception("expected a TTL value"); } }
[ "public", "long", "getTTL", "(", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"a TTL value\"", ")", ";", "try", "{", "return", "TTL", ".", "parseTTL", "(", "next", ")", ";", "}", "catch", "(", "NumberFormatException", ...
Gets the next token from a tokenizer and parses it as a TTL. @return The next token in the stream, as an unsigned 32 bit integer. @throws TextParseException The input was not valid. @throws IOException An I/O error occurred. @see TTL
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "parses", "it", "as", "a", "TTL", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L472-L481
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getTTLLike
public long getTTLLike() throws IOException { String next = _getIdentifier("a TTL-like value"); try { return TTL.parse(next, false); } catch (NumberFormatException e) { throw exception("expected a TTL-like value"); } }
java
public long getTTLLike() throws IOException { String next = _getIdentifier("a TTL-like value"); try { return TTL.parse(next, false); } catch (NumberFormatException e) { throw exception("expected a TTL-like value"); } }
[ "public", "long", "getTTLLike", "(", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"a TTL-like value\"", ")", ";", "try", "{", "return", "TTL", ".", "parse", "(", "next", ",", "false", ")", ";", "}", "catch", "(", "Nu...
Gets the next token from a tokenizer and parses it as if it were a TTL. @return The next token in the stream, as an unsigned 32 bit integer. @throws TextParseException The input was not valid. @throws IOException An I/O error occurred. @see TTL
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "parses", "it", "as", "if", "it", "were", "a", "TTL", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L490-L499
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getName
public Name getName(Name origin) throws IOException { String next = _getIdentifier("a name"); try { Name name = Name.fromString(next, origin); if (!name.isAbsolute()) throw new RelativeNameException(name); return name; } catch (TextParseException e) { throw exception(e.getMessage()); } }
java
public Name getName(Name origin) throws IOException { String next = _getIdentifier("a name"); try { Name name = Name.fromString(next, origin); if (!name.isAbsolute()) throw new RelativeNameException(name); return name; } catch (TextParseException e) { throw exception(e.getMessage()); } }
[ "public", "Name", "getName", "(", "Name", "origin", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"a name\"", ")", ";", "try", "{", "Name", "name", "=", "Name", ".", "fromString", "(", "next", ",", "origin", ")", ";",...
Gets the next token from a tokenizer and converts it to a name. @param origin The origin to append to relative names. @return The next token in the stream, as a name. @throws TextParseException The input was invalid or not a valid name. @throws IOException An I/O error occurred. @throws RelativeNameException The parsed...
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "converts", "it", "to", "a", "name", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L511-L523
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getAddressBytes
public byte [] getAddressBytes(int family) throws IOException { String next = _getIdentifier("an address"); byte [] bytes = Address.toByteArray(next, family); if (bytes == null) throw exception("Invalid address: " + next); return bytes; }
java
public byte [] getAddressBytes(int family) throws IOException { String next = _getIdentifier("an address"); byte [] bytes = Address.toByteArray(next, family); if (bytes == null) throw exception("Invalid address: " + next); return bytes; }
[ "public", "byte", "[", "]", "getAddressBytes", "(", "int", "family", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"an address\"", ")", ";", "byte", "[", "]", "bytes", "=", "Address", ".", "toByteArray", "(", "next", ",...
Gets the next token from a tokenizer and converts it to a byte array containing an IP address. @param family The address family. @return The next token in the stream, as an byte array representing an IP address. @throws TextParseException The input was invalid or not a valid address. @throws IOException An I/O error oc...
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "converts", "it", "to", "a", "byte", "array", "containing", "an", "IP", "address", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L535-L542
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getAddress
public InetAddress getAddress(int family) throws IOException { String next = _getIdentifier("an address"); try { return Address.getByAddress(next, family); } catch (UnknownHostException e) { throw exception(e.getMessage()); } }
java
public InetAddress getAddress(int family) throws IOException { String next = _getIdentifier("an address"); try { return Address.getByAddress(next, family); } catch (UnknownHostException e) { throw exception(e.getMessage()); } }
[ "public", "InetAddress", "getAddress", "(", "int", "family", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"an address\"", ")", ";", "try", "{", "return", "Address", ".", "getByAddress", "(", "next", ",", "family", ")", "...
Gets the next token from a tokenizer and converts it to an IP Address. @param family The address family. @return The next token in the stream, as an InetAddress @throws TextParseException The input was invalid or not a valid address. @throws IOException An I/O error occurred. @see Address
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "converts", "it", "to", "an", "IP", "Address", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L552-L561
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getEOL
public void getEOL() throws IOException { Token next = get(); if (next.type != EOL && next.type != EOF) { throw exception("expected EOL or EOF"); } }
java
public void getEOL() throws IOException { Token next = get(); if (next.type != EOL && next.type != EOF) { throw exception("expected EOL or EOF"); } }
[ "public", "void", "getEOL", "(", ")", "throws", "IOException", "{", "Token", "next", "=", "get", "(", ")", ";", "if", "(", "next", ".", "type", "!=", "EOL", "&&", "next", ".", "type", "!=", "EOF", ")", "{", "throw", "exception", "(", "\"expected EOL ...
Gets the next token from a tokenizer, which must be an EOL or EOF. @throws TextParseException The input was invalid or not an EOL or EOF token. @throws IOException An I/O error occurred.
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "which", "must", "be", "an", "EOL", "or", "EOF", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L568-L574
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.remainingStrings
private String remainingStrings() throws IOException { StringBuffer buffer = null; while (true) { Tokenizer.Token t = get(); if (!t.isString()) break; if (buffer == null) buffer = new StringBuffer(); ...
java
private String remainingStrings() throws IOException { StringBuffer buffer = null; while (true) { Tokenizer.Token t = get(); if (!t.isString()) break; if (buffer == null) buffer = new StringBuffer(); ...
[ "private", "String", "remainingStrings", "(", ")", "throws", "IOException", "{", "StringBuffer", "buffer", "=", "null", ";", "while", "(", "true", ")", "{", "Tokenizer", ".", "Token", "t", "=", "get", "(", ")", ";", "if", "(", "!", "t", ".", "isString"...
Returns a concatenation of the remaining strings from a Tokenizer.
[ "Returns", "a", "concatenation", "of", "the", "remaining", "strings", "from", "a", "Tokenizer", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L579-L594
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getHexString
public byte [] getHexString() throws IOException { String next = _getIdentifier("a hex string"); byte [] array = base16.fromString(next); if (array == null) throw exception("invalid hex encoding"); return array; }
java
public byte [] getHexString() throws IOException { String next = _getIdentifier("a hex string"); byte [] array = base16.fromString(next); if (array == null) throw exception("invalid hex encoding"); return array; }
[ "public", "byte", "[", "]", "getHexString", "(", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"a hex string\"", ")", ";", "byte", "[", "]", "array", "=", "base16", ".", "fromString", "(", "next", ")", ";", "if", "(",...
Gets the next token from a tokenizer and decodes it as hex. @return The byte array containing the decoded string. @throws TextParseException The input was invalid. @throws IOException An I/O error occurred.
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "decodes", "it", "as", "hex", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L678-L685
train
dnsjava/dnsjava
org/xbill/DNS/Tokenizer.java
Tokenizer.getBase32String
public byte [] getBase32String(base32 b32) throws IOException { String next = _getIdentifier("a base32 string"); byte [] array = b32.fromString(next); if (array == null) throw exception("invalid base32 encoding"); return array; }
java
public byte [] getBase32String(base32 b32) throws IOException { String next = _getIdentifier("a base32 string"); byte [] array = b32.fromString(next); if (array == null) throw exception("invalid base32 encoding"); return array; }
[ "public", "byte", "[", "]", "getBase32String", "(", "base32", "b32", ")", "throws", "IOException", "{", "String", "next", "=", "_getIdentifier", "(", "\"a base32 string\"", ")", ";", "byte", "[", "]", "array", "=", "b32", ".", "fromString", "(", "next", ")...
Gets the next token from a tokenizer and decodes it as base32. @param b32 The base32 context to decode with. @return The byte array containing the decoded string. @throws TextParseException The input was invalid. @throws IOException An I/O error occurred.
[ "Gets", "the", "next", "token", "from", "a", "tokenizer", "and", "decodes", "it", "as", "base32", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L694-L701
train
dnsjava/dnsjava
org/xbill/DNS/Serial.java
Serial.compare
public static int compare(long serial1, long serial2) { if (serial1 < 0 || serial1 > MAX32) throw new IllegalArgumentException(serial1 + " out of range"); if (serial2 < 0 || serial2 > MAX32) throw new IllegalArgumentException(serial2 + " out of range"); long diff = serial1 - serial2; if (diff >= MAX32) diff -...
java
public static int compare(long serial1, long serial2) { if (serial1 < 0 || serial1 > MAX32) throw new IllegalArgumentException(serial1 + " out of range"); if (serial2 < 0 || serial2 > MAX32) throw new IllegalArgumentException(serial2 + " out of range"); long diff = serial1 - serial2; if (diff >= MAX32) diff -...
[ "public", "static", "int", "compare", "(", "long", "serial1", ",", "long", "serial2", ")", "{", "if", "(", "serial1", "<", "0", "||", "serial1", ">", "MAX32", ")", "throw", "new", "IllegalArgumentException", "(", "serial1", "+", "\" out of range\"", ")", "...
Compares two numbers using serial arithmetic. The numbers are assumed to be 32 bit unsigned integers stored in longs. @param serial1 The first integer @param serial2 The second integer @return 0 if the 2 numbers are equal, a positive number if serial1 is greater than serial2, and a negative number if serial2 is greate...
[ "Compares", "two", "numbers", "using", "serial", "arithmetic", ".", "The", "numbers", "are", "assumed", "to", "be", "32", "bit", "unsigned", "integers", "stored", "in", "longs", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Serial.java#L30-L42
train
dnsjava/dnsjava
org/xbill/DNS/Serial.java
Serial.increment
public static long increment(long serial) { if (serial < 0 || serial > MAX32) throw new IllegalArgumentException(serial + " out of range"); if (serial == MAX32) return 0; return serial + 1; }
java
public static long increment(long serial) { if (serial < 0 || serial > MAX32) throw new IllegalArgumentException(serial + " out of range"); if (serial == MAX32) return 0; return serial + 1; }
[ "public", "static", "long", "increment", "(", "long", "serial", ")", "{", "if", "(", "serial", "<", "0", "||", "serial", ">", "MAX32", ")", "throw", "new", "IllegalArgumentException", "(", "serial", "+", "\" out of range\"", ")", ";", "if", "(", "serial", ...
Increments a serial number. The number is assumed to be a 32 bit unsigned integer stored in a long. This basically adds 1 and resets the value to 0 if it is 2^32. @param serial The serial number @return The incremented serial number @throws IllegalArgumentException serial is out of range
[ "Increments", "a", "serial", "number", ".", "The", "number", "is", "assumed", "to", "be", "a", "32", "bit", "unsigned", "integer", "stored", "in", "a", "long", ".", "This", "basically", "adds", "1", "and", "resets", "the", "value", "to", "0", "if", "it...
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Serial.java#L52-L59
train
dnsjava/dnsjava
org/xbill/DNS/SimpleResolver.java
SimpleResolver.send
public Message send(Message query) throws IOException { if (Options.check("verbose")) System.err.println("Sending to " + address.getAddress().getHostAddress() + ":" + address.getPort()); if (query.getHeader().getOpcode() == Opcode.QUERY) { Record question = query.getQuestion(); if (question != nu...
java
public Message send(Message query) throws IOException { if (Options.check("verbose")) System.err.println("Sending to " + address.getAddress().getHostAddress() + ":" + address.getPort()); if (query.getHeader().getOpcode() == Opcode.QUERY) { Record question = query.getQuestion(); if (question != nu...
[ "public", "Message", "send", "(", "Message", "query", ")", "throws", "IOException", "{", "if", "(", "Options", ".", "check", "(", "\"verbose\"", ")", ")", "System", ".", "err", ".", "println", "(", "\"Sending to \"", "+", "address", ".", "getAddress", "(",...
Sends a message to a single server and waits for a response. No checking is done to ensure that the response is associated with the query. @param query The query to send. @return The response. @throws IOException An error occurred while sending or receiving.
[ "Sends", "a", "message", "to", "a", "single", "server", "and", "waits", "for", "a", "response", ".", "No", "checking", "is", "done", "to", "ensure", "that", "the", "response", "is", "associated", "with", "the", "query", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/SimpleResolver.java#L226-L297
train
dnsjava/dnsjava
org/xbill/DNS/SimpleResolver.java
SimpleResolver.sendAsync
public Object sendAsync(final Message query, final ResolverListener listener) { final Object id; synchronized (this) { id = new Integer(uniqueID++); } Record question = query.getQuestion(); String qname; if (question != null) qname = question.getName().toString(); else qname = "(none)"; String name = this...
java
public Object sendAsync(final Message query, final ResolverListener listener) { final Object id; synchronized (this) { id = new Integer(uniqueID++); } Record question = query.getQuestion(); String qname; if (question != null) qname = question.getName().toString(); else qname = "(none)"; String name = this...
[ "public", "Object", "sendAsync", "(", "final", "Message", "query", ",", "final", "ResolverListener", "listener", ")", "{", "final", "Object", "id", ";", "synchronized", "(", "this", ")", "{", "id", "=", "new", "Integer", "(", "uniqueID", "++", ")", ";", ...
Asynchronously sends a message to a single server, registering a listener to receive a callback on success or exception. Multiple asynchronous lookups can be performed in parallel. Since the callback may be invoked before the function returns, external synchronization is necessary. @param query The query to send @par...
[ "Asynchronously", "sends", "a", "message", "to", "a", "single", "server", "registering", "a", "listener", "to", "receive", "a", "callback", "on", "success", "or", "exception", ".", "Multiple", "asynchronous", "lookups", "can", "be", "performed", "in", "parallel"...
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/SimpleResolver.java#L308-L326
train
dnsjava/dnsjava
org/xbill/DNS/Options.java
Options.set
public static void set(String option) { if (table == null) table = new HashMap(); table.put(option.toLowerCase(), "true"); }
java
public static void set(String option) { if (table == null) table = new HashMap(); table.put(option.toLowerCase(), "true"); }
[ "public", "static", "void", "set", "(", "String", "option", ")", "{", "if", "(", "table", "==", "null", ")", "table", "=", "new", "HashMap", "(", ")", ";", "table", ".", "put", "(", "option", ".", "toLowerCase", "(", ")", ",", "\"true\"", ")", ";",...
Sets an option to "true"
[ "Sets", "an", "option", "to", "true" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Options.java#L66-L71
train
dnsjava/dnsjava
org/xbill/DNS/Options.java
Options.check
public static boolean check(String option) { if (table == null) return false; return (table.get(option.toLowerCase()) != null); }
java
public static boolean check(String option) { if (table == null) return false; return (table.get(option.toLowerCase()) != null); }
[ "public", "static", "boolean", "check", "(", "String", "option", ")", "{", "if", "(", "table", "==", "null", ")", "return", "false", ";", "return", "(", "table", ".", "get", "(", "option", ".", "toLowerCase", "(", ")", ")", "!=", "null", ")", ";", ...
Checks if an option is defined
[ "Checks", "if", "an", "option", "is", "defined" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Options.java#L90-L95
train
dnsjava/dnsjava
org/xbill/DNS/Options.java
Options.value
public static String value(String option) { if (table == null) return null; return ((String)table.get(option.toLowerCase())); }
java
public static String value(String option) { if (table == null) return null; return ((String)table.get(option.toLowerCase())); }
[ "public", "static", "String", "value", "(", "String", "option", ")", "{", "if", "(", "table", "==", "null", ")", "return", "null", ";", "return", "(", "(", "String", ")", "table", ".", "get", "(", "option", ".", "toLowerCase", "(", ")", ")", ")", "...
Returns the value of an option
[ "Returns", "the", "value", "of", "an", "option" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Options.java#L98-L103
train
dnsjava/dnsjava
org/xbill/DNS/Options.java
Options.intValue
public static int intValue(String option) { String s = value(option); if (s != null) { try { int val = Integer.parseInt(s); if (val > 0) return (val); } catch (NumberFormatException e) { } } return (-1); }
java
public static int intValue(String option) { String s = value(option); if (s != null) { try { int val = Integer.parseInt(s); if (val > 0) return (val); } catch (NumberFormatException e) { } } return (-1); }
[ "public", "static", "int", "intValue", "(", "String", "option", ")", "{", "String", "s", "=", "value", "(", "option", ")", ";", "if", "(", "s", "!=", "null", ")", "{", "try", "{", "int", "val", "=", "Integer", ".", "parseInt", "(", "s", ")", ";",...
Returns the value of an option as an integer, or -1 if not defined.
[ "Returns", "the", "value", "of", "an", "option", "as", "an", "integer", "or", "-", "1", "if", "not", "defined", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Options.java#L108-L121
train
dnsjava/dnsjava
org/xbill/DNS/ResolveThread.java
ResolveThread.run
public void run() { try { Message response = res.send(query); listener.receiveMessage(id, response); } catch (Exception e) { listener.handleException(id, e); } }
java
public void run() { try { Message response = res.send(query); listener.receiveMessage(id, response); } catch (Exception e) { listener.handleException(id, e); } }
[ "public", "void", "run", "(", ")", "{", "try", "{", "Message", "response", "=", "res", ".", "send", "(", "query", ")", ";", "listener", ".", "receiveMessage", "(", "id", ",", "response", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "lis...
Performs the query, and executes the callback.
[ "Performs", "the", "query", "and", "executes", "the", "callback", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ResolveThread.java#L34-L43
train
dnsjava/dnsjava
org/xbill/DNS/HINFORecord.java
HINFORecord.rrToString
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(byteArrayToString(cpu, true)); sb.append(" "); sb.append(byteArrayToString(os, true)); return sb.toString(); }
java
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(byteArrayToString(cpu, true)); sb.append(" "); sb.append(byteArrayToString(os, true)); return sb.toString(); }
[ "String", "rrToString", "(", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "byteArrayToString", "(", "cpu", ",", "true", ")", ")", ";", "sb", ".", "append", "(", "\" \"", ")", ";", "sb", ".", "...
Converts to a string
[ "Converts", "to", "a", "string" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/HINFORecord.java#L86-L93
train
dnsjava/dnsjava
org/xbill/DNS/SetResponse.java
SetResponse.answers
public RRset [] answers() { if (type != SUCCESSFUL) return null; List l = (List) data; return (RRset []) l.toArray(new RRset[l.size()]); }
java
public RRset [] answers() { if (type != SUCCESSFUL) return null; List l = (List) data; return (RRset []) l.toArray(new RRset[l.size()]); }
[ "public", "RRset", "[", "]", "answers", "(", ")", "{", "if", "(", "type", "!=", "SUCCESSFUL", ")", "return", "null", ";", "List", "l", "=", "(", "List", ")", "data", ";", "return", "(", "RRset", "[", "]", ")", "l", ".", "toArray", "(", "new", "...
If the query was successful, return the answers
[ "If", "the", "query", "was", "successful", "return", "the", "answers" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/SetResponse.java#L155-L161
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.newRecord
public static Record newRecord(Name name, int type, int dclass, long ttl) { if (!name.isAbsolute()) throw new RelativeNameException(name); Type.check(type); DClass.check(dclass); TTL.check(ttl); return getEmptyRecord(name, type, dclass, ttl, false); }
java
public static Record newRecord(Name name, int type, int dclass, long ttl) { if (!name.isAbsolute()) throw new RelativeNameException(name); Type.check(type); DClass.check(dclass); TTL.check(ttl); return getEmptyRecord(name, type, dclass, ttl, false); }
[ "public", "static", "Record", "newRecord", "(", "Name", "name", ",", "int", "type", ",", "int", "dclass", ",", "long", "ttl", ")", "{", "if", "(", "!", "name", ".", "isAbsolute", "(", ")", ")", "throw", "new", "RelativeNameException", "(", "name", ")",...
Creates a new empty record, with the given parameters. @param name The owner name of the record. @param type The record's type. @param dclass The record's class. @param ttl The record's time to live. @return An object of a subclass of Record
[ "Creates", "a", "new", "empty", "record", "with", "the", "given", "parameters", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L150-L159
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.newRecord
public static Record newRecord(Name name, int type, int dclass) { return newRecord(name, type, dclass, 0); }
java
public static Record newRecord(Name name, int type, int dclass) { return newRecord(name, type, dclass, 0); }
[ "public", "static", "Record", "newRecord", "(", "Name", "name", ",", "int", "type", ",", "int", "dclass", ")", "{", "return", "newRecord", "(", "name", ",", "type", ",", "dclass", ",", "0", ")", ";", "}" ]
Creates a new empty record, with the given parameters. This method is designed to create records that will be added to the QUERY section of a message. @param name The owner name of the record. @param type The record's type. @param dclass The record's class. @return An object of a subclass of Record
[ "Creates", "a", "new", "empty", "record", "with", "the", "given", "parameters", ".", "This", "method", "is", "designed", "to", "create", "records", "that", "will", "be", "added", "to", "the", "QUERY", "section", "of", "a", "message", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L170-L173
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.fromWire
public static Record fromWire(byte [] b, int section) throws IOException { return fromWire(new DNSInput(b), section, false); }
java
public static Record fromWire(byte [] b, int section) throws IOException { return fromWire(new DNSInput(b), section, false); }
[ "public", "static", "Record", "fromWire", "(", "byte", "[", "]", "b", ",", "int", "section", ")", "throws", "IOException", "{", "return", "fromWire", "(", "new", "DNSInput", "(", "b", ")", ",", "section", ",", "false", ")", ";", "}" ]
Builds a Record from DNS uncompressed wire format.
[ "Builds", "a", "Record", "from", "DNS", "uncompressed", "wire", "format", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L207-L210
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.toWire
public byte [] toWire(int section) { DNSOutput out = new DNSOutput(); toWire(out, section, null); return out.toByteArray(); }
java
public byte [] toWire(int section) { DNSOutput out = new DNSOutput(); toWire(out, section, null); return out.toByteArray(); }
[ "public", "byte", "[", "]", "toWire", "(", "int", "section", ")", "{", "DNSOutput", "out", "=", "new", "DNSOutput", "(", ")", ";", "toWire", "(", "out", ",", "section", ",", "null", ")", ";", "return", "out", ".", "toByteArray", "(", ")", ";", "}" ...
Converts a Record into DNS uncompressed wire format.
[ "Converts", "a", "Record", "into", "DNS", "uncompressed", "wire", "format", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L230-L235
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.byteArrayFromString
protected static byte [] byteArrayFromString(String s) throws TextParseException { byte [] array = s.getBytes(); boolean escaped = false; boolean hasEscapes = false; for (int i = 0; i < array.length; i++) { if (array[i] == '\\') { hasEscapes = true; break; } } if (!hasEscapes) { if (array.length > 25...
java
protected static byte [] byteArrayFromString(String s) throws TextParseException { byte [] array = s.getBytes(); boolean escaped = false; boolean hasEscapes = false; for (int i = 0; i < array.length; i++) { if (array[i] == '\\') { hasEscapes = true; break; } } if (!hasEscapes) { if (array.length > 25...
[ "protected", "static", "byte", "[", "]", "byteArrayFromString", "(", "String", "s", ")", "throws", "TextParseException", "{", "byte", "[", "]", "array", "=", "s", ".", "getBytes", "(", ")", ";", "boolean", "escaped", "=", "false", ";", "boolean", "hasEscap...
Converts a String into a byte array.
[ "Converts", "a", "String", "into", "a", "byte", "array", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L337-L395
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.byteArrayToString
protected static String byteArrayToString(byte [] array, boolean quote) { StringBuffer sb = new StringBuffer(); if (quote) sb.append('"'); for (int i = 0; i < array.length; i++) { int b = array[i] & 0xFF; if (b < 0x20 || b >= 0x7f) { sb.append('\\'); sb.append(byteFormat.format(b)); } else if (b == '"'...
java
protected static String byteArrayToString(byte [] array, boolean quote) { StringBuffer sb = new StringBuffer(); if (quote) sb.append('"'); for (int i = 0; i < array.length; i++) { int b = array[i] & 0xFF; if (b < 0x20 || b >= 0x7f) { sb.append('\\'); sb.append(byteFormat.format(b)); } else if (b == '"'...
[ "protected", "static", "String", "byteArrayToString", "(", "byte", "[", "]", "array", ",", "boolean", "quote", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "quote", ")", "sb", ".", "append", "(", "'", "'", ")", ...
Converts a byte array into a String.
[ "Converts", "a", "byte", "array", "into", "a", "String", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L400-L419
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.unknownToString
protected static String unknownToString(byte [] data) { StringBuffer sb = new StringBuffer(); sb.append("\\# "); sb.append(data.length); sb.append(" "); sb.append(base16.toString(data)); return sb.toString(); }
java
protected static String unknownToString(byte [] data) { StringBuffer sb = new StringBuffer(); sb.append("\\# "); sb.append(data.length); sb.append(" "); sb.append(base16.toString(data)); return sb.toString(); }
[ "protected", "static", "String", "unknownToString", "(", "byte", "[", "]", "data", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "\"\\\\# \"", ")", ";", "sb", ".", "append", "(", "data", ".", "leng...
Converts a byte array into the unknown RR format.
[ "Converts", "a", "byte", "array", "into", "the", "unknown", "RR", "format", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L424-L432
train
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.sameRRset
public boolean sameRRset(Record rec) { return (getRRsetType() == rec.getRRsetType() && dclass == rec.dclass && name.equals(rec.name)); }
java
public boolean sameRRset(Record rec) { return (getRRsetType() == rec.getRRsetType() && dclass == rec.dclass && name.equals(rec.name)); }
[ "public", "boolean", "sameRRset", "(", "Record", "rec", ")", "{", "return", "(", "getRRsetType", "(", ")", "==", "rec", ".", "getRRsetType", "(", ")", "&&", "dclass", "==", "rec", ".", "dclass", "&&", "name", ".", "equals", "(", "rec", ".", "name", "...
Determines if two Records could be part of the same RRset. This compares the name, type, and class of the Records; the ttl and rdata are not compared.
[ "Determines", "if", "two", "Records", "could", "be", "part", "of", "the", "same", "RRset", ".", "This", "compares", "the", "name", "type", "and", "class", "of", "the", "Records", ";", "the", "ttl", "and", "rdata", "are", "not", "compared", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L561-L566
train
dnsjava/dnsjava
org/xbill/DNS/Header.java
Header.printFlags
public String printFlags() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < 16; i++) if (validFlag(i) && getFlag(i)) { sb.append(Flags.string(i)); sb.append(" "); } return sb.toString(); }
java
public String printFlags() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < 16; i++) if (validFlag(i) && getFlag(i)) { sb.append(Flags.string(i)); sb.append(" "); } return sb.toString(); }
[ "public", "String", "printFlags", "(", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "16", ";", "i", "++", ")", "if", "(", "validFlag", "(", "i", ")", "&&", "getFlag", ...
Converts the header's flags into a String
[ "Converts", "the", "header", "s", "flags", "into", "a", "String" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Header.java#L255-L265
train
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.getDefaultCache
public static synchronized Cache getDefaultCache(int dclass) { DClass.check(dclass); Cache c = (Cache) defaultCaches.get(Mnemonic.toInteger(dclass)); if (c == null) { c = new Cache(dclass); defaultCaches.put(Mnemonic.toInteger(dclass), c); } return c; }
java
public static synchronized Cache getDefaultCache(int dclass) { DClass.check(dclass); Cache c = (Cache) defaultCaches.get(Mnemonic.toInteger(dclass)); if (c == null) { c = new Cache(dclass); defaultCaches.put(Mnemonic.toInteger(dclass), c); } return c; }
[ "public", "static", "synchronized", "Cache", "getDefaultCache", "(", "int", "dclass", ")", "{", "DClass", ".", "check", "(", "dclass", ")", ";", "Cache", "c", "=", "(", "Cache", ")", "defaultCaches", ".", "get", "(", "Mnemonic", ".", "toInteger", "(", "d...
Gets the Cache that will be used as the default for the specified class by future Lookups. @param dclass The class whose cache is being retrieved. @return The default cache for the specified class.
[ "Gets", "the", "Cache", "that", "will", "be", "used", "as", "the", "default", "for", "the", "specified", "class", "by", "future", "Lookups", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L124-L133
train
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.setDefaultCache
public static synchronized void setDefaultCache(Cache cache, int dclass) { DClass.check(dclass); defaultCaches.put(Mnemonic.toInteger(dclass), cache); }
java
public static synchronized void setDefaultCache(Cache cache, int dclass) { DClass.check(dclass); defaultCaches.put(Mnemonic.toInteger(dclass), cache); }
[ "public", "static", "synchronized", "void", "setDefaultCache", "(", "Cache", "cache", ",", "int", "dclass", ")", "{", "DClass", ".", "check", "(", "dclass", ")", ";", "defaultCaches", ".", "put", "(", "Mnemonic", ".", "toInteger", "(", "dclass", ")", ",", ...
Sets the Cache to be used as the default for the specified class by future Lookups. @param cache The default cache for the specified class. @param dclass The class whose cache is being set.
[ "Sets", "the", "Cache", "to", "be", "used", "as", "the", "default", "for", "the", "specified", "class", "by", "future", "Lookups", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L141-L145
train
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.setDefaultSearchPath
public static synchronized void setDefaultSearchPath(String [] domains) throws TextParseException { if (domains == null) { defaultSearchPath = null; return; } Name [] newdomains = new Name[domains.length]; for (int i = 0; i < domains.length; i++) newdomains[i] = Name.fromString(domains[i], Name.root); defaul...
java
public static synchronized void setDefaultSearchPath(String [] domains) throws TextParseException { if (domains == null) { defaultSearchPath = null; return; } Name [] newdomains = new Name[domains.length]; for (int i = 0; i < domains.length; i++) newdomains[i] = Name.fromString(domains[i], Name.root); defaul...
[ "public", "static", "synchronized", "void", "setDefaultSearchPath", "(", "String", "[", "]", "domains", ")", "throws", "TextParseException", "{", "if", "(", "domains", "==", "null", ")", "{", "defaultSearchPath", "=", "null", ";", "return", ";", "}", "Name", ...
Sets the search path that will be used as the default by future Lookups. @param domains The default search path. @throws TextParseException A name in the array is not a valid DNS name.
[ "Sets", "the", "search", "path", "that", "will", "be", "used", "as", "the", "default", "by", "future", "Lookups", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L170-L180
train
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.setSearchPath
public void setSearchPath(String [] domains) throws TextParseException { if (domains == null) { this.searchPath = null; return; } Name [] newdomains = new Name[domains.length]; for (int i = 0; i < domains.length; i++) newdomains[i] = Name.fromString(domains[i], Name.root); this.searchPath = newdomains; }
java
public void setSearchPath(String [] domains) throws TextParseException { if (domains == null) { this.searchPath = null; return; } Name [] newdomains = new Name[domains.length]; for (int i = 0; i < domains.length; i++) newdomains[i] = Name.fromString(domains[i], Name.root); this.searchPath = newdomains; }
[ "public", "void", "setSearchPath", "(", "String", "[", "]", "domains", ")", "throws", "TextParseException", "{", "if", "(", "domains", "==", "null", ")", "{", "this", ".", "searchPath", "=", "null", ";", "return", ";", "}", "Name", "[", "]", "newdomains"...
Sets the search path to use when performing this lookup. This overrides the default value. @param domains An array of names containing the search path. @throws TextParseException A name in the array is not a valid DNS name.
[ "Sets", "the", "search", "path", "to", "use", "when", "performing", "this", "lookup", ".", "This", "overrides", "the", "default", "value", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L339-L349
train
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.setCache
public void setCache(Cache cache) { if (cache == null) { this.cache = new Cache(dclass); this.temporary_cache = true; } else { this.cache = cache; this.temporary_cache = false; } }
java
public void setCache(Cache cache) { if (cache == null) { this.cache = new Cache(dclass); this.temporary_cache = true; } else { this.cache = cache; this.temporary_cache = false; } }
[ "public", "void", "setCache", "(", "Cache", "cache", ")", "{", "if", "(", "cache", "==", "null", ")", "{", "this", ".", "cache", "=", "new", "Cache", "(", "dclass", ")", ";", "this", ".", "temporary_cache", "=", "true", ";", "}", "else", "{", "this...
Sets the cache to use when performing this lookup. This overrides the default value. If the results of this lookup should not be permanently cached, null can be provided here. @param cache The cache to use.
[ "Sets", "the", "cache", "to", "use", "when", "performing", "this", "lookup", ".", "This", "overrides", "the", "default", "value", ".", "If", "the", "results", "of", "this", "lookup", "should", "not", "be", "permanently", "cached", "null", "can", "be", "pro...
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L357-L366
train
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.run
public Record [] run() { if (done) reset(); if (name.isAbsolute()) resolve(name, null); else if (searchPath == null) resolve(name, Name.root); else { if (name.labels() > defaultNdots) resolve(name, Name.root); if (done) return answers; for (int i = 0; i < searchPath.length; i++) { resolve(name...
java
public Record [] run() { if (done) reset(); if (name.isAbsolute()) resolve(name, null); else if (searchPath == null) resolve(name, Name.root); else { if (name.labels() > defaultNdots) resolve(name, Name.root); if (done) return answers; for (int i = 0; i < searchPath.length; i++) { resolve(name...
[ "public", "Record", "[", "]", "run", "(", ")", "{", "if", "(", "done", ")", "reset", "(", ")", ";", "if", "(", "name", ".", "isAbsolute", "(", ")", ")", "resolve", "(", "name", ",", "null", ")", ";", "else", "if", "(", "searchPath", "==", "null...
Performs the lookup, using the specified Cache, Resolver, and search path. @return The answers, or null if none are found.
[ "Performs", "the", "lookup", "using", "the", "specified", "Cache", "Resolver", "and", "search", "path", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L536-L585
train
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.getErrorString
public String getErrorString() { checkDone(); if (error != null) return error; switch (result) { case SUCCESSFUL: return "successful"; case UNRECOVERABLE: return "unrecoverable error"; case TRY_AGAIN: return "try again"; case HOST_NOT_FOUND: return "host not found"; case TYPE_NOT_FOUND: return "type not...
java
public String getErrorString() { checkDone(); if (error != null) return error; switch (result) { case SUCCESSFUL: return "successful"; case UNRECOVERABLE: return "unrecoverable error"; case TRY_AGAIN: return "try again"; case HOST_NOT_FOUND: return "host not found"; case TYPE_NOT_FOUND: return "type not...
[ "public", "String", "getErrorString", "(", ")", "{", "checkDone", "(", ")", ";", "if", "(", "error", "!=", "null", ")", "return", "error", ";", "switch", "(", "result", ")", "{", "case", "SUCCESSFUL", ":", "return", "\"successful\"", ";", "case", "UNRECO...
Returns an error string describing the result code of this lookup. @return A string, which may either directly correspond the result code or be more specific. @throws IllegalStateException The lookup has not completed.
[ "Returns", "an", "error", "string", "describing", "the", "result", "code", "of", "this", "lookup", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L642-L655
train
dnsjava/dnsjava
org/xbill/DNS/Type.java
Type.value
public static int value(String s, boolean numberok) { int val = types.getValue(s); if (val == -1 && numberok) { val = types.getValue("TYPE" + s); } return val; }
java
public static int value(String s, boolean numberok) { int val = types.getValue(s); if (val == -1 && numberok) { val = types.getValue("TYPE" + s); } return val; }
[ "public", "static", "int", "value", "(", "String", "s", ",", "boolean", "numberok", ")", "{", "int", "val", "=", "types", ".", "getValue", "(", "s", ")", ";", "if", "(", "val", "==", "-", "1", "&&", "numberok", ")", "{", "val", "=", "types", ".",...
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.
[ "Converts", "a", "String", "representation", "of", "an", "Type", "into", "its", "numeric", "value", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Type.java#L338-L345
train
dnsjava/dnsjava
org/xbill/DNS/AAAARecord.java
AAAARecord.getAddress
public InetAddress getAddress() { try { if (name == null) return InetAddress.getByAddress(address); else return InetAddress.getByAddress(name.toString(), address); } catch (UnknownHostException e) { return null; } }
java
public InetAddress getAddress() { try { if (name == null) return InetAddress.getByAddress(address); else return InetAddress.getByAddress(name.toString(), address); } catch (UnknownHostException e) { return null; } }
[ "public", "InetAddress", "getAddress", "(", ")", "{", "try", "{", "if", "(", "name", "==", "null", ")", "return", "InetAddress", ".", "getByAddress", "(", "address", ")", ";", "else", "return", "InetAddress", ".", "getByAddress", "(", "name", ".", "toStrin...
Returns the address
[ "Returns", "the", "address" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/AAAARecord.java#L72-L83
train
dnsjava/dnsjava
org/xbill/DNS/RRset.java
RRset.addRR
public synchronized void addRR(Record r) { if (rrs.size() == 0) { safeAddRR(r); return; } Record first = first(); if (!r.sameRRset(first)) throw new IllegalArgumentException("record does not match " + "rrset"); if (r.getTTL() != first.getTTL()) { if (r.getTTL() > first.getTTL()) { r = r.cloneR...
java
public synchronized void addRR(Record r) { if (rrs.size() == 0) { safeAddRR(r); return; } Record first = first(); if (!r.sameRRset(first)) throw new IllegalArgumentException("record does not match " + "rrset"); if (r.getTTL() != first.getTTL()) { if (r.getTTL() > first.getTTL()) { r = r.cloneR...
[ "public", "synchronized", "void", "addRR", "(", "Record", "r", ")", "{", "if", "(", "rrs", ".", "size", "(", ")", "==", "0", ")", "{", "safeAddRR", "(", "r", ")", ";", "return", ";", "}", "Record", "first", "=", "first", "(", ")", ";", "if", "(...
Adds a Record to an RRset
[ "Adds", "a", "Record", "to", "an", "RRset" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/RRset.java#L68-L95
train
dnsjava/dnsjava
org/xbill/DNS/ResolverConfig.java
ResolverConfig.findProperty
private boolean findProperty() { String prop; List lserver = new ArrayList(0); List lsearch = new ArrayList(0); StringTokenizer st; prop = System.getProperty("dns.server"); if (prop != null) { st = new StringTokenizer(prop, ","); while (st.hasMoreTokens()) addServer(st.nextToken(), lserver); } prop = S...
java
private boolean findProperty() { String prop; List lserver = new ArrayList(0); List lsearch = new ArrayList(0); StringTokenizer st; prop = System.getProperty("dns.server"); if (prop != null) { st = new StringTokenizer(prop, ","); while (st.hasMoreTokens()) addServer(st.nextToken(), lserver); } prop = S...
[ "private", "boolean", "findProperty", "(", ")", "{", "String", "prop", ";", "List", "lserver", "=", "new", "ArrayList", "(", "0", ")", ";", "List", "lsearch", "=", "new", "ArrayList", "(", "0", ")", ";", "StringTokenizer", "st", ";", "prop", "=", "Syst...
Looks in the system properties to find servers and a search path. Servers are defined by dns.server=server1,server2... The search path is defined by dns.search=domain1,domain2...
[ "Looks", "in", "the", "system", "properties", "to", "find", "servers", "and", "a", "search", "path", ".", "Servers", "are", "defined", "by", "dns", ".", "server", "=", "server1", "server2", "...", "The", "search", "path", "is", "defined", "by", "dns", "....
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ResolverConfig.java#L132-L154
train
dnsjava/dnsjava
org/xbill/DNS/ResolverConfig.java
ResolverConfig.find95
private void find95() { String s = "winipcfg.out"; try { Process p; p = Runtime.getRuntime().exec("winipcfg /all /batch " + s); p.waitFor(); File f = new File(s); findWin(new FileInputStream(f)); new File(s).delete(); } catch (Exception e) { return; } }
java
private void find95() { String s = "winipcfg.out"; try { Process p; p = Runtime.getRuntime().exec("winipcfg /all /batch " + s); p.waitFor(); File f = new File(s); findWin(new FileInputStream(f)); new File(s).delete(); } catch (Exception e) { return; } }
[ "private", "void", "find95", "(", ")", "{", "String", "s", "=", "\"winipcfg.out\"", ";", "try", "{", "Process", "p", ";", "p", "=", "Runtime", ".", "getRuntime", "(", ")", ".", "exec", "(", "\"winipcfg /all /batch \"", "+", "s", ")", ";", "p", ".", "...
Calls winipcfg and parses the result to find servers and a search path.
[ "Calls", "winipcfg", "and", "parses", "the", "result", "to", "find", "servers", "and", "a", "search", "path", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ResolverConfig.java#L391-L405
train
dnsjava/dnsjava
org/xbill/DNS/ResolverConfig.java
ResolverConfig.findNT
private void findNT() { try { Process p; p = Runtime.getRuntime().exec("ipconfig /all"); findWin(p.getInputStream()); p.destroy(); } catch (Exception e) { return; } }
java
private void findNT() { try { Process p; p = Runtime.getRuntime().exec("ipconfig /all"); findWin(p.getInputStream()); p.destroy(); } catch (Exception e) { return; } }
[ "private", "void", "findNT", "(", ")", "{", "try", "{", "Process", "p", ";", "p", "=", "Runtime", ".", "getRuntime", "(", ")", ".", "exec", "(", "\"ipconfig /all\"", ")", ";", "findWin", "(", "p", ".", "getInputStream", "(", ")", ")", ";", "p", "."...
Calls ipconfig and parses the result to find servers and a search path.
[ "Calls", "ipconfig", "and", "parses", "the", "result", "to", "find", "servers", "and", "a", "search", "path", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ResolverConfig.java#L410-L421
train
dnsjava/dnsjava
org/xbill/DNS/DNSOutput.java
DNSOutput.writeU16
public void writeU16(int val) { check(val, 16); need(2); array[pos++] = (byte)((val >>> 8) & 0xFF); array[pos++] = (byte)(val & 0xFF); }
java
public void writeU16(int val) { check(val, 16); need(2); array[pos++] = (byte)((val >>> 8) & 0xFF); array[pos++] = (byte)(val & 0xFF); }
[ "public", "void", "writeU16", "(", "int", "val", ")", "{", "check", "(", "val", ",", "16", ")", ";", "need", "(", "2", ")", ";", "array", "[", "pos", "++", "]", "=", "(", "byte", ")", "(", "(", "val", ">>>", "8", ")", "&", "0xFF", ")", ";",...
Writes an unsigned 16 bit value to the stream. @param val The value to be written
[ "Writes", "an", "unsigned", "16", "bit", "value", "to", "the", "stream", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSOutput.java#L119-L125
train
dnsjava/dnsjava
org/xbill/DNS/DNSOutput.java
DNSOutput.writeU16At
public void writeU16At(int val, int where) { check(val, 16); if (where > pos - 2) throw new IllegalArgumentException("cannot write past " + "end of data"); array[where++] = (byte)((val >>> 8) & 0xFF); array[where++] = (byte)(val & 0xFF); }
java
public void writeU16At(int val, int where) { check(val, 16); if (where > pos - 2) throw new IllegalArgumentException("cannot write past " + "end of data"); array[where++] = (byte)((val >>> 8) & 0xFF); array[where++] = (byte)(val & 0xFF); }
[ "public", "void", "writeU16At", "(", "int", "val", ",", "int", "where", ")", "{", "check", "(", "val", ",", "16", ")", ";", "if", "(", "where", ">", "pos", "-", "2", ")", "throw", "new", "IllegalArgumentException", "(", "\"cannot write past \"", "+", "...
Writes an unsigned 16 bit value to the specified position in the stream. @param val The value to be written @param where The position to write the value.
[ "Writes", "an", "unsigned", "16", "bit", "value", "to", "the", "specified", "position", "in", "the", "stream", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSOutput.java#L132-L140
train
dnsjava/dnsjava
org/xbill/DNS/DNSOutput.java
DNSOutput.writeU32
public void writeU32(long val) { check(val, 32); need(4); array[pos++] = (byte)((val >>> 24) & 0xFF); array[pos++] = (byte)((val >>> 16) & 0xFF); array[pos++] = (byte)((val >>> 8) & 0xFF); array[pos++] = (byte)(val & 0xFF); }
java
public void writeU32(long val) { check(val, 32); need(4); array[pos++] = (byte)((val >>> 24) & 0xFF); array[pos++] = (byte)((val >>> 16) & 0xFF); array[pos++] = (byte)((val >>> 8) & 0xFF); array[pos++] = (byte)(val & 0xFF); }
[ "public", "void", "writeU32", "(", "long", "val", ")", "{", "check", "(", "val", ",", "32", ")", ";", "need", "(", "4", ")", ";", "array", "[", "pos", "++", "]", "=", "(", "byte", ")", "(", "(", "val", ">>>", "24", ")", "&", "0xFF", ")", ";...
Writes an unsigned 32 bit value to the stream. @param val The value to be written
[ "Writes", "an", "unsigned", "32", "bit", "value", "to", "the", "stream", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSOutput.java#L146-L154
train
dnsjava/dnsjava
org/xbill/DNS/DNSOutput.java
DNSOutput.writeByteArray
public void writeByteArray(byte [] b, int off, int len) { need(len); System.arraycopy(b, off, array, pos, len); pos += len; }
java
public void writeByteArray(byte [] b, int off, int len) { need(len); System.arraycopy(b, off, array, pos, len); pos += len; }
[ "public", "void", "writeByteArray", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "{", "need", "(", "len", ")", ";", "System", ".", "arraycopy", "(", "b", ",", "off", ",", "array", ",", "pos", ",", "len", ")", ";", "pos...
Writes a byte array to the stream. @param b The array to write. @param off The offset of the array to start copying data from. @param len The number of bytes to write.
[ "Writes", "a", "byte", "array", "to", "the", "stream", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSOutput.java#L162-L167
train
dnsjava/dnsjava
org/xbill/DNS/DNSOutput.java
DNSOutput.writeCountedString
public void writeCountedString(byte [] s) { if (s.length > 0xFF) { throw new IllegalArgumentException("Invalid counted string"); } need(1 + s.length); array[pos++] = (byte)(s.length & 0xFF); writeByteArray(s, 0, s.length); }
java
public void writeCountedString(byte [] s) { if (s.length > 0xFF) { throw new IllegalArgumentException("Invalid counted string"); } need(1 + s.length); array[pos++] = (byte)(s.length & 0xFF); writeByteArray(s, 0, s.length); }
[ "public", "void", "writeCountedString", "(", "byte", "[", "]", "s", ")", "{", "if", "(", "s", ".", "length", ">", "0xFF", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid counted string\"", ")", ";", "}", "need", "(", "1", "+", "s", ...
Writes a counted string from the stream. A counted string is a one byte value indicating string length, followed by bytes of data. @param s The string to write.
[ "Writes", "a", "counted", "string", "from", "the", "stream", ".", "A", "counted", "string", "is", "a", "one", "byte", "value", "indicating", "string", "length", "followed", "by", "bytes", "of", "data", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSOutput.java#L183-L191
train
dnsjava/dnsjava
org/xbill/DNS/NSEC3PARAMRecord.java
NSEC3PARAMRecord.hashName
public byte [] hashName(Name name) throws NoSuchAlgorithmException { return NSEC3Record.hashName(name, hashAlg, iterations, salt); }
java
public byte [] hashName(Name name) throws NoSuchAlgorithmException { return NSEC3Record.hashName(name, hashAlg, iterations, salt); }
[ "public", "byte", "[", "]", "hashName", "(", "Name", "name", ")", "throws", "NoSuchAlgorithmException", "{", "return", "NSEC3Record", ".", "hashName", "(", "name", ",", "hashAlg", ",", "iterations", ",", "salt", ")", ";", "}" ]
Hashes a name with the parameters of this NSEC3PARAM record. @param name The name to hash @return The hashed version of the name @throws NoSuchAlgorithmException The hash algorithm is unknown.
[ "Hashes", "a", "name", "with", "the", "parameters", "of", "this", "NSEC3PARAM", "record", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/NSEC3PARAMRecord.java#L159-L163
train
dnsjava/dnsjava
org/xbill/DNS/Generator.java
Generator.supportedType
public static boolean supportedType(int type) { Type.check(type); return (type == Type.PTR || type == Type.CNAME || type == Type.DNAME || type == Type.A || type == Type.AAAA || type == Type.NS); }
java
public static boolean supportedType(int type) { Type.check(type); return (type == Type.PTR || type == Type.CNAME || type == Type.DNAME || type == Type.A || type == Type.AAAA || type == Type.NS); }
[ "public", "static", "boolean", "supportedType", "(", "int", "type", ")", "{", "Type", ".", "check", "(", "type", ")", ";", "return", "(", "type", "==", "Type", ".", "PTR", "||", "type", "==", "Type", ".", "CNAME", "||", "type", "==", "Type", ".", "...
Indicates whether generation is supported for this type. @throws InvalidTypeException The type is out of range.
[ "Indicates", "whether", "generation", "is", "supported", "for", "this", "type", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Generator.java#L49-L54
train
dnsjava/dnsjava
org/xbill/DNS/Generator.java
Generator.nextRecord
public Record nextRecord() throws IOException { if (current > end) return null; String namestr = substitute(namePattern, current); Name name = Name.fromString(namestr, origin); String rdata = substitute(rdataPattern, current); current += step; return Record.fromString(name, type, dclass, ttl, rdata, origin); }
java
public Record nextRecord() throws IOException { if (current > end) return null; String namestr = substitute(namePattern, current); Name name = Name.fromString(namestr, origin); String rdata = substitute(rdataPattern, current); current += step; return Record.fromString(name, type, dclass, ttl, rdata, origin); }
[ "public", "Record", "nextRecord", "(", ")", "throws", "IOException", "{", "if", "(", "current", ">", "end", ")", "return", "null", ";", "String", "namestr", "=", "substitute", "(", "namePattern", ",", "current", ")", ";", "Name", "name", "=", "Name", "."...
Constructs and returns the next record in the expansion. @throws IOException The name or rdata was invalid after substitutions were performed.
[ "Constructs", "and", "returns", "the", "next", "record", "in", "the", "expansion", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Generator.java#L214-L223
train
dnsjava/dnsjava
org/xbill/DNS/Generator.java
Generator.expand
public Record [] expand() throws IOException { List list = new ArrayList(); for (long i = start; i < end; i += step) { String namestr = substitute(namePattern, current); Name name = Name.fromString(namestr, origin); String rdata = substitute(rdataPattern, current); list.add(Record.fromString(name, type, dclas...
java
public Record [] expand() throws IOException { List list = new ArrayList(); for (long i = start; i < end; i += step) { String namestr = substitute(namePattern, current); Name name = Name.fromString(namestr, origin); String rdata = substitute(rdataPattern, current); list.add(Record.fromString(name, type, dclas...
[ "public", "Record", "[", "]", "expand", "(", ")", "throws", "IOException", "{", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "long", "i", "=", "start", ";", "i", "<", "end", ";", "i", "+=", "step", ")", "{", "String", "name...
Constructs and returns all records in the expansion. @throws IOException The name or rdata of a record was invalid after substitutions were performed.
[ "Constructs", "and", "returns", "all", "records", "in", "the", "expansion", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Generator.java#L230-L241
train
dnsjava/dnsjava
org/xbill/DNS/RPRecord.java
RPRecord.rrToString
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(mailbox); sb.append(" "); sb.append(textDomain); return sb.toString(); }
java
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(mailbox); sb.append(" "); sb.append(textDomain); return sb.toString(); }
[ "String", "rrToString", "(", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "mailbox", ")", ";", "sb", ".", "append", "(", "\" \"", ")", ";", "sb", ".", "append", "(", "textDomain", ")", ";", "r...
Converts the RP Record to a String
[ "Converts", "the", "RP", "Record", "to", "a", "String" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/RPRecord.java#L55-L62
train
dnsjava/dnsjava
org/xbill/DNS/FormattedTime.java
FormattedTime.format
public static String format(Date date) { Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); StringBuffer sb = new StringBuffer(); c.setTime(date); sb.append(w4.format(c.get(Calendar.YEAR))); sb.append(w2.format(c.get(Calendar.MONTH)+1)); sb.append(w2.format(c.get(Calendar.DAY_OF_MONTH))); sb.appen...
java
public static String format(Date date) { Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); StringBuffer sb = new StringBuffer(); c.setTime(date); sb.append(w4.format(c.get(Calendar.YEAR))); sb.append(w2.format(c.get(Calendar.MONTH)+1)); sb.append(w2.format(c.get(Calendar.DAY_OF_MONTH))); sb.appen...
[ "public", "static", "String", "format", "(", "Date", "date", ")", "{", "Calendar", "c", "=", "new", "GregorianCalendar", "(", "TimeZone", ".", "getTimeZone", "(", "\"UTC\"", ")", ")", ";", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", ...
Converts a Date into a formatted string. @param date The Date to convert. @return The formatted string.
[ "Converts", "a", "Date", "into", "a", "formatted", "string", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/FormattedTime.java#L35-L48
train
dnsjava/dnsjava
org/xbill/DNS/FormattedTime.java
FormattedTime.parse
public static Date parse(String s) throws TextParseException { if (s.length() != 14) { throw new TextParseException("Invalid time encoding: " + s); } Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); c.clear(); try { int year = Integer.parseInt(s.substring(0, 4)); int month = Integer.parseInt...
java
public static Date parse(String s) throws TextParseException { if (s.length() != 14) { throw new TextParseException("Invalid time encoding: " + s); } Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); c.clear(); try { int year = Integer.parseInt(s.substring(0, 4)); int month = Integer.parseInt...
[ "public", "static", "Date", "parse", "(", "String", "s", ")", "throws", "TextParseException", "{", "if", "(", "s", ".", "length", "(", ")", "!=", "14", ")", "{", "throw", "new", "TextParseException", "(", "\"Invalid time encoding: \"", "+", "s", ")", ";", ...
Parses a formatted time string into a Date. @param s The string, in the form YYYYMMDDHHMMSS. @return The Date object. @throws TextParseExcetption The string was invalid.
[ "Parses", "a", "formatted", "time", "string", "into", "a", "Date", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/FormattedTime.java#L56-L77
train
dnsjava/dnsjava
org/xbill/DNS/ARecord.java
ARecord.getAddress
public InetAddress getAddress() { try { if (name == null) return InetAddress.getByAddress(toArray(addr)); else return InetAddress.getByAddress(name.toString(), toArray(addr)); } catch (UnknownHostException e) { return null; } }
java
public InetAddress getAddress() { try { if (name == null) return InetAddress.getByAddress(toArray(addr)); else return InetAddress.getByAddress(name.toString(), toArray(addr)); } catch (UnknownHostException e) { return null; } }
[ "public", "InetAddress", "getAddress", "(", ")", "{", "try", "{", "if", "(", "name", "==", "null", ")", "return", "InetAddress", ".", "getByAddress", "(", "toArray", "(", "addr", ")", ")", ";", "else", "return", "InetAddress", ".", "getByAddress", "(", "...
Returns the Internet address
[ "Returns", "the", "Internet", "address" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ARecord.java#L74-L85
train
dnsjava/dnsjava
org/xbill/DNS/MINFORecord.java
MINFORecord.rrToString
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(responsibleAddress); sb.append(" "); sb.append(errorAddress); return sb.toString(); }
java
String rrToString() { StringBuffer sb = new StringBuffer(); sb.append(responsibleAddress); sb.append(" "); sb.append(errorAddress); return sb.toString(); }
[ "String", "rrToString", "(", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "responsibleAddress", ")", ";", "sb", ".", "append", "(", "\" \"", ")", ";", "sb", ".", "append", "(", "errorAddress", ")"...
Converts the MINFO Record to a String
[ "Converts", "the", "MINFO", "Record", "to", "a", "String" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/MINFORecord.java#L60-L67
train
dnsjava/dnsjava
org/xbill/DNS/DNSSEC.java
DNSSEC.verify
public static void verify(RRset rrset, RRSIGRecord rrsig, DNSKEYRecord key) throws DNSSECException { if (!matches(rrsig, key)) throw new KeyMismatchException(key, rrsig); Date now = new Date(); if (now.compareTo(rrsig.getExpire()) > 0) throw new SignatureExpiredException(rrsig.getExpire(), now); if (now.compar...
java
public static void verify(RRset rrset, RRSIGRecord rrsig, DNSKEYRecord key) throws DNSSECException { if (!matches(rrsig, key)) throw new KeyMismatchException(key, rrsig); Date now = new Date(); if (now.compareTo(rrsig.getExpire()) > 0) throw new SignatureExpiredException(rrsig.getExpire(), now); if (now.compar...
[ "public", "static", "void", "verify", "(", "RRset", "rrset", ",", "RRSIGRecord", "rrsig", ",", "DNSKEYRecord", "key", ")", "throws", "DNSSECException", "{", "if", "(", "!", "matches", "(", "rrsig", ",", "key", ")", ")", "throw", "new", "KeyMismatchException"...
Verify a DNSSEC signature. @param rrset The data to be verified. @param rrsig The RRSIG record containing the signature. @param key The DNSKEY record to verify the signature with. @throws UnsupportedAlgorithmException The algorithm is unknown @throws MalformedKeyException The key is malformed @throws KeyMismatchExcepti...
[ "Verify", "a", "DNSSEC", "signature", "." ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSSEC.java#L921-L936
train
dnsjava/dnsjava
org/xbill/DNS/DNSSEC.java
DNSSEC.generateDSDigest
static byte [] generateDSDigest(DNSKEYRecord key, int digestid) { MessageDigest digest; try { switch (digestid) { case DSRecord.Digest.SHA1: digest = MessageDigest.getInstance("sha-1"); break; case DSRecord.Digest.SHA256: digest = MessageDigest.getInstance("sha-256"); break; case DSRecord.Digest.G...
java
static byte [] generateDSDigest(DNSKEYRecord key, int digestid) { MessageDigest digest; try { switch (digestid) { case DSRecord.Digest.SHA1: digest = MessageDigest.getInstance("sha-1"); break; case DSRecord.Digest.SHA256: digest = MessageDigest.getInstance("sha-256"); break; case DSRecord.Digest.G...
[ "static", "byte", "[", "]", "generateDSDigest", "(", "DNSKEYRecord", "key", ",", "int", "digestid", ")", "{", "MessageDigest", "digest", ";", "try", "{", "switch", "(", "digestid", ")", "{", "case", "DSRecord", ".", "Digest", ".", "SHA1", ":", "digest", ...
Generate the digest value for a DS key @param key Which is covered by the DS record @param digestid The type of digest @return The digest value as an array of bytes
[ "Generate", "the", "digest", "value", "for", "a", "DS", "key" ]
d97b6a0685d59143372bb392ab591dd8dd840b61
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSSEC.java#L1137-L1166
train
zalando/spring-cloud-config-aws-kms
src/main/java/de/zalando/spring/cloud/config/aws/kms/EncryptedToken.java
EncryptedToken.parseKeyValueMap
private static Map<String, String> parseKeyValueMap(String kvString, Function<String, String> valueMapper) { return Stream.of( Optional.ofNullable(kvString) .map(StringUtils::trimAllWhitespace) .filter(StringUtils::hasText) ...
java
private static Map<String, String> parseKeyValueMap(String kvString, Function<String, String> valueMapper) { return Stream.of( Optional.ofNullable(kvString) .map(StringUtils::trimAllWhitespace) .filter(StringUtils::hasText) ...
[ "private", "static", "Map", "<", "String", ",", "String", ">", "parseKeyValueMap", "(", "String", "kvString", ",", "Function", "<", "String", ",", "String", ">", "valueMapper", ")", "{", "return", "Stream", ".", "of", "(", "Optional", ".", "ofNullable", "(...
Parses a key-value pair string such as "param1=WdfaA,param2=AZrr,param3" into a map. <p>Keys with no value are assigned an empty string for convenience. The `valueMapper` function is applied to all values of the map</p> @param kvString a string containing key value pairs. Multiple pairs are separated by comma ',' ...
[ "Parses", "a", "key", "-", "value", "pair", "string", "such", "as", "param1", "=", "WdfaA", "param2", "=", "AZrr", "param3", "into", "a", "map", "." ]
c54638d3de4737003b754cf37d722e6051f04d4f
https://github.com/zalando/spring-cloud-config-aws-kms/blob/c54638d3de4737003b754cf37d722e6051f04d4f/src/main/java/de/zalando/spring/cloud/config/aws/kms/EncryptedToken.java#L101-L113
train
HubSpot/Horizon
HorizonNing/src/main/java/com/hubspot/horizon/ning/internal/NingFuture.java
NingFuture.setNonnull
public boolean setNonnull(HttpResponse response) { Preconditions.checkNotNull(response); if (set(response)) { callback.completed(response); return true; } else { return false; } }
java
public boolean setNonnull(HttpResponse response) { Preconditions.checkNotNull(response); if (set(response)) { callback.completed(response); return true; } else { return false; } }
[ "public", "boolean", "setNonnull", "(", "HttpResponse", "response", ")", "{", "Preconditions", ".", "checkNotNull", "(", "response", ")", ";", "if", "(", "set", "(", "response", ")", ")", "{", "callback", ".", "completed", "(", "response", ")", ";", "retur...
superclass method has @Nullable on the argument so make a separate method
[ "superclass", "method", "has" ]
e10453337d995f27a259188a6cc247c6b2f1d74a
https://github.com/HubSpot/Horizon/blob/e10453337d995f27a259188a6cc247c6b2f1d74a/HorizonNing/src/main/java/com/hubspot/horizon/ning/internal/NingFuture.java#L18-L26
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/util/Documents.java
Documents.registerAccessor
public static void registerAccessor(Class<?> documentType, DocumentAccessor accessor) { Assert.notNull(documentType, "documentType may not be null"); Assert.notNull(accessor, "accessor may not be null"); if (accessors.containsKey(documentType)) { DocumentAccessor existing = getAccessor(documentType); LOG.wa...
java
public static void registerAccessor(Class<?> documentType, DocumentAccessor accessor) { Assert.notNull(documentType, "documentType may not be null"); Assert.notNull(accessor, "accessor may not be null"); if (accessors.containsKey(documentType)) { DocumentAccessor existing = getAccessor(documentType); LOG.wa...
[ "public", "static", "void", "registerAccessor", "(", "Class", "<", "?", ">", "documentType", ",", "DocumentAccessor", "accessor", ")", "{", "Assert", ".", "notNull", "(", "documentType", ",", "\"documentType may not be null\"", ")", ";", "Assert", ".", "notNull", ...
Used to register a custom DocumentAccessor for a particular class. Any existing accessor for the class will be overridden. @param documentType @param accessor
[ "Used", "to", "register", "a", "custom", "DocumentAccessor", "for", "a", "particular", "class", ".", "Any", "existing", "accessor", "for", "the", "class", "will", "be", "overridden", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/util/Documents.java#L47-L56
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/util/Documents.java
Documents.setId
public static void setId(Object document, String id) { DocumentAccessor d = getAccessor(document); if (d.hasIdMutator()) { d.setId(document, id); } }
java
public static void setId(Object document, String id) { DocumentAccessor d = getAccessor(document); if (d.hasIdMutator()) { d.setId(document, id); } }
[ "public", "static", "void", "setId", "(", "Object", "document", ",", "String", "id", ")", "{", "DocumentAccessor", "d", "=", "getAccessor", "(", "document", ")", ";", "if", "(", "d", ".", "hasIdMutator", "(", ")", ")", "{", "d", ".", "setId", "(", "d...
Will set the id property on the document IF a mutator exists. Otherwise nothing happens. @param document @param id
[ "Will", "set", "the", "id", "property", "on", "the", "document", "IF", "a", "mutator", "exists", ".", "Otherwise", "nothing", "happens", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/util/Documents.java#L69-L74
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/support/AttachmentsInOrderParser.java
AttachmentsInOrderParser.parseAttachmentNames
public static List<String> parseAttachmentNames(JsonParser documentJsonParser) throws IOException { documentJsonParser.nextToken(); JsonToken jsonToken; while((jsonToken = documentJsonParser.nextToken()) != JsonToken.END_OBJECT) { if(CouchDbDocument.ATTACHMENTS_NAME.equa...
java
public static List<String> parseAttachmentNames(JsonParser documentJsonParser) throws IOException { documentJsonParser.nextToken(); JsonToken jsonToken; while((jsonToken = documentJsonParser.nextToken()) != JsonToken.END_OBJECT) { if(CouchDbDocument.ATTACHMENTS_NAME.equa...
[ "public", "static", "List", "<", "String", ">", "parseAttachmentNames", "(", "JsonParser", "documentJsonParser", ")", "throws", "IOException", "{", "documentJsonParser", ".", "nextToken", "(", ")", ";", "JsonToken", "jsonToken", ";", "while", "(", "(", "jsonToken"...
Parses a CouchDB document in the form of a JsonParser to get the attachments order. It is important that the JsonParser come straight from the source document and not from an object, or the order will be incorrect. @param documentJsonParser a JsonParser which is at the very root of a JSON CouchDB document @return the l...
[ "Parses", "a", "CouchDB", "document", "in", "the", "form", "of", "a", "JsonParser", "to", "get", "the", "attachments", "order", ".", "It", "is", "important", "that", "the", "JsonParser", "come", "straight", "from", "the", "source", "document", "and", "not", ...
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/support/AttachmentsInOrderParser.java#L33-L50
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/PurgeResult.java
PurgeResult.setAnonymous
@JsonAnySetter public void setAnonymous(String key, Object value) { anonymous().put(key, value); }
java
@JsonAnySetter public void setAnonymous(String key, Object value) { anonymous().put(key, value); }
[ "@", "JsonAnySetter", "public", "void", "setAnonymous", "(", "String", "key", ",", "Object", "value", ")", "{", "anonymous", "(", ")", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
Exists in order to future proof this class. @param key @param value
[ "Exists", "in", "order", "to", "future", "proof", "this", "class", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/PurgeResult.java#L44-L47
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/impl/jackson/EktorpBeanDeserializerModifier.java
EktorpBeanDeserializerModifier.constructSettableProperty
protected SettableBeanProperty constructSettableProperty( DeserializationConfig config, BeanDescription beanDesc, String name, AnnotatedMethod setter, JavaType type) { // need to ensure method is callable (for non-public) if (config .isEnabled(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS)) { Method memb...
java
protected SettableBeanProperty constructSettableProperty( DeserializationConfig config, BeanDescription beanDesc, String name, AnnotatedMethod setter, JavaType type) { // need to ensure method is callable (for non-public) if (config .isEnabled(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS)) { Method memb...
[ "protected", "SettableBeanProperty", "constructSettableProperty", "(", "DeserializationConfig", "config", ",", "BeanDescription", "beanDesc", ",", "String", "name", ",", "AnnotatedMethod", "setter", ",", "JavaType", "type", ")", "{", "// need to ensure method is callable (for...
Method copied from org.codehaus.jackson.map.deser.BeanDeserializerFactory
[ "Method", "copied", "from", "org", ".", "codehaus", ".", "jackson", ".", "map", ".", "deser", ".", "BeanDeserializerFactory" ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/impl/jackson/EktorpBeanDeserializerModifier.java#L107-L136
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/impl/DocIdResponseHandler.java
DocIdResponseHandler.parseRows
private List<String> parseRows(JsonParser jp, List<String> result) throws IOException { while(jp.nextToken() == JsonToken.START_OBJECT) { while(jp.nextToken() == JsonToken.FIELD_NAME) { String fieldName = jp.getCurrentName(); jp.nextToken(); ...
java
private List<String> parseRows(JsonParser jp, List<String> result) throws IOException { while(jp.nextToken() == JsonToken.START_OBJECT) { while(jp.nextToken() == JsonToken.FIELD_NAME) { String fieldName = jp.getCurrentName(); jp.nextToken(); ...
[ "private", "List", "<", "String", ">", "parseRows", "(", "JsonParser", "jp", ",", "List", "<", "String", ">", "result", ")", "throws", "IOException", "{", "while", "(", "jp", ".", "nextToken", "(", ")", "==", "JsonToken", ".", "START_OBJECT", ")", "{", ...
The token is required to be on the START_ARRAY value for rows. @param jp @param result @return The results found in the rows object
[ "The", "token", "is", "required", "to", "be", "on", "the", "START_ARRAY", "value", "for", "rows", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/impl/DocIdResponseHandler.java#L33-L47
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/BulkDeleteDocument.java
BulkDeleteDocument.of
public static BulkDeleteDocument of(Object o) { return new BulkDeleteDocument(Documents.getId(o), Documents.getRevision(o)); }
java
public static BulkDeleteDocument of(Object o) { return new BulkDeleteDocument(Documents.getId(o), Documents.getRevision(o)); }
[ "public", "static", "BulkDeleteDocument", "of", "(", "Object", "o", ")", "{", "return", "new", "BulkDeleteDocument", "(", "Documents", ".", "getId", "(", "o", ")", ",", "Documents", ".", "getRevision", "(", "o", ")", ")", ";", "}" ]
Will create a bulk delete document based on the specified object. @param o @return
[ "Will", "create", "a", "bulk", "delete", "document", "based", "on", "the", "specified", "object", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/BulkDeleteDocument.java#L26-L28
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/Options.java
Options.param
public Options param(String name, String value) { options.put(name, value); return this; }
java
public Options param(String name, String value) { options.put(name, value); return this; }
[ "public", "Options", "param", "(", "String", "name", ",", "String", "value", ")", "{", "options", ".", "put", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds a parameter to the GET request sent to the database. @param name @param value @return
[ "Adds", "a", "parameter", "to", "the", "GET", "request", "sent", "to", "the", "database", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/Options.java#L43-L46
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/support/CouchDbRepositorySupport.java
CouchDbRepositorySupport.createQuery
protected ViewQuery createQuery(String viewName) { return new ViewQuery() .dbPath(db.path()) .designDocId(stdDesignDocumentId) .viewName(viewName); }
java
protected ViewQuery createQuery(String viewName) { return new ViewQuery() .dbPath(db.path()) .designDocId(stdDesignDocumentId) .viewName(viewName); }
[ "protected", "ViewQuery", "createQuery", "(", "String", "viewName", ")", "{", "return", "new", "ViewQuery", "(", ")", ".", "dbPath", "(", "db", ".", "path", "(", ")", ")", ".", "designDocId", "(", "stdDesignDocumentId", ")", ".", "viewName", "(", "viewName...
Creates a ViewQuery pre-configured with correct dbPath, design document id and view name. @param viewName @return
[ "Creates", "a", "ViewQuery", "pre", "-", "configured", "with", "correct", "dbPath", "design", "document", "id", "and", "view", "name", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/support/CouchDbRepositorySupport.java#L193-L198
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/support/CouchDbRepositorySupport.java
CouchDbRepositorySupport.queryView
protected List<T> queryView(String viewName, ComplexKey key) { return db.queryView(createQuery(viewName) .includeDocs(true) .key(key), type); }
java
protected List<T> queryView(String viewName, ComplexKey key) { return db.queryView(createQuery(viewName) .includeDocs(true) .key(key), type); }
[ "protected", "List", "<", "T", ">", "queryView", "(", "String", "viewName", ",", "ComplexKey", "key", ")", "{", "return", "db", ".", "queryView", "(", "createQuery", "(", "viewName", ")", ".", "includeDocs", "(", "true", ")", ".", "key", "(", "key", ")...
Allows subclasses to query views with simple String value keys and load the result as the repository's handled type. The viewName must be defined in this repository's design document. @param viewName @param key @return
[ "Allows", "subclasses", "to", "query", "views", "with", "simple", "String", "value", "keys", "and", "load", "the", "result", "as", "the", "repository", "s", "handled", "type", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/support/CouchDbRepositorySupport.java#L241-L246
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/support/CouchDbRepositorySupport.java
CouchDbRepositorySupport.backOff
private void backOff() { try { Thread.sleep(new Random().nextInt(400)); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } }
java
private void backOff() { try { Thread.sleep(new Random().nextInt(400)); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } }
[ "private", "void", "backOff", "(", ")", "{", "try", "{", "Thread", ".", "sleep", "(", "new", "Random", "(", ")", ".", "nextInt", "(", "400", ")", ")", ";", "}", "catch", "(", "InterruptedException", "ie", ")", "{", "Thread", ".", "currentThread", "("...
Wait a short while in order to prevent racing initializations from other repositories.
[ "Wait", "a", "short", "while", "in", "order", "to", "prevent", "racing", "initializations", "from", "other", "repositories", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/support/CouchDbRepositorySupport.java#L325-L331
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/dataload/DefaultDataLoader.java
DefaultDataLoader.load
public void load(Reader in) { try { doLoad(in); } catch (Exception e) { throw Exceptions.propagate(e); } }
java
public void load(Reader in) { try { doLoad(in); } catch (Exception e) { throw Exceptions.propagate(e); } }
[ "public", "void", "load", "(", "Reader", "in", ")", "{", "try", "{", "doLoad", "(", "in", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "Exceptions", ".", "propagate", "(", "e", ")", ";", "}", "}" ]
Reads documents from the reader and stores them in the database. @param in
[ "Reads", "documents", "from", "the", "reader", "and", "stores", "them", "in", "the", "database", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/dataload/DefaultDataLoader.java#L41-L47
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/impl/BulkDocumentWriter.java
BulkDocumentWriter.write
public void write(Collection<?> objects, boolean allOrNothing, OutputStream out) { try { JsonGenerator jg = objectMapper.getFactory().createGenerator(out, JsonEncoding.UTF8); jg.writeStartObject(); if (allOrNothing) { jg.writeBooleanField("all_or_nothing", true); } jg.writeArrayFieldStart("docs"); ...
java
public void write(Collection<?> objects, boolean allOrNothing, OutputStream out) { try { JsonGenerator jg = objectMapper.getFactory().createGenerator(out, JsonEncoding.UTF8); jg.writeStartObject(); if (allOrNothing) { jg.writeBooleanField("all_or_nothing", true); } jg.writeArrayFieldStart("docs"); ...
[ "public", "void", "write", "(", "Collection", "<", "?", ">", "objects", ",", "boolean", "allOrNothing", ",", "OutputStream", "out", ")", "{", "try", "{", "JsonGenerator", "jg", "=", "objectMapper", ".", "getFactory", "(", ")", ".", "createGenerator", "(", ...
Writes the objects collection as a bulk operation document. The output stream is flushed and closed by this method. @param objects @param allOrNothing @param out
[ "Writes", "the", "objects", "collection", "as", "a", "bulk", "operation", "document", ".", "The", "output", "stream", "is", "flushed", "and", "closed", "by", "this", "method", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/impl/BulkDocumentWriter.java#L30-L50
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/impl/StdObjectMapperFactory.java
StdObjectMapperFactory.applyDefaultConfiguration
protected void applyDefaultConfiguration(ObjectMapper om) { om.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, this.writeDatesAsTimestamps); om.setSerializationInclusion(JsonInclude.Include.NON_NULL); }
java
protected void applyDefaultConfiguration(ObjectMapper om) { om.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, this.writeDatesAsTimestamps); om.setSerializationInclusion(JsonInclude.Include.NON_NULL); }
[ "protected", "void", "applyDefaultConfiguration", "(", "ObjectMapper", "om", ")", "{", "om", ".", "configure", "(", "SerializationFeature", ".", "WRITE_DATES_AS_TIMESTAMPS", ",", "this", ".", "writeDatesAsTimestamps", ")", ";", "om", ".", "setSerializationInclusion", ...
This protected method can be overridden in order to change the configuration.
[ "This", "protected", "method", "can", "be", "overridden", "in", "order", "to", "change", "the", "configuration", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/impl/StdObjectMapperFactory.java#L51-L55
train
helun/Ektorp
org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidSSLSocketFactory.java
AndroidSSLSocketFactory.connectSocket
public Socket connectSocket( final Socket sock, final String host, final int port, final InetAddress localAddress, int localPort, final HttpParams params ) throws IOException { if (host == null) { throw new IllegalArgumentException("Target host ma...
java
public Socket connectSocket( final Socket sock, final String host, final int port, final InetAddress localAddress, int localPort, final HttpParams params ) throws IOException { if (host == null) { throw new IllegalArgumentException("Target host ma...
[ "public", "Socket", "connectSocket", "(", "final", "Socket", "sock", ",", "final", "String", "host", ",", "final", "int", "port", ",", "final", "InetAddress", "localAddress", ",", "int", "localPort", ",", "final", "HttpParams", "params", ")", "throws", "IOExce...
non-javadoc, see interface org.apache.http.conn.SocketFactory
[ "non", "-", "javadoc", "see", "interface", "org", ".", "apache", ".", "http", ".", "conn", ".", "SocketFactory" ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidSSLSocketFactory.java#L273-L326
train
helun/Ektorp
org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidSSLSocketFactory.java
AndroidSSLSocketFactory.createSocket
public Socket createSocket( final Socket socket, final String host, final int port, final boolean autoClose ) throws IOException, UnknownHostException { SSLSocket sslSocket = (SSLSocket) this.socketfactory.createSocket( socket, host, ...
java
public Socket createSocket( final Socket socket, final String host, final int port, final boolean autoClose ) throws IOException, UnknownHostException { SSLSocket sslSocket = (SSLSocket) this.socketfactory.createSocket( socket, host, ...
[ "public", "Socket", "createSocket", "(", "final", "Socket", "socket", ",", "final", "String", "host", ",", "final", "int", "port", ",", "final", "boolean", "autoClose", ")", "throws", "IOException", ",", "UnknownHostException", "{", "SSLSocket", "sslSocket", "="...
non-javadoc, see interface LayeredSocketFactory
[ "non", "-", "javadoc", "see", "interface", "LayeredSocketFactory" ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidSSLSocketFactory.java#L365-L380
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/util/ReflectionUtils.java
ReflectionUtils.findMethod
public static Method findMethod(Class<?> clazz, String name) { for (Method me : clazz.getDeclaredMethods()) { if (me.getName().equalsIgnoreCase(name)) { return me; } } if (clazz.getSuperclass() != null) { return findMethod(clazz.getSuperclass(), name); } return null; }
java
public static Method findMethod(Class<?> clazz, String name) { for (Method me : clazz.getDeclaredMethods()) { if (me.getName().equalsIgnoreCase(name)) { return me; } } if (clazz.getSuperclass() != null) { return findMethod(clazz.getSuperclass(), name); } return null; }
[ "public", "static", "Method", "findMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ")", "{", "for", "(", "Method", "me", ":", "clazz", ".", "getDeclaredMethods", "(", ")", ")", "{", "if", "(", "me", ".", "getName", "(", ")", "...
Ignores case when comparing method names @param clazz @param name @return
[ "Ignores", "case", "when", "comparing", "method", "names" ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/util/ReflectionUtils.java#L77-L87
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/http/StdResponseHandler.java
StdResponseHandler.createDbAccessException
public static DbAccessException createDbAccessException(HttpResponse hr) { JsonNode responseBody; try { InputStream content = hr.getContent(); if (content != null) { responseBody = responseBodyAsNode(IOUtils.toString(content)); } else { responseBod...
java
public static DbAccessException createDbAccessException(HttpResponse hr) { JsonNode responseBody; try { InputStream content = hr.getContent(); if (content != null) { responseBody = responseBodyAsNode(IOUtils.toString(content)); } else { responseBod...
[ "public", "static", "DbAccessException", "createDbAccessException", "(", "HttpResponse", "hr", ")", "{", "JsonNode", "responseBody", ";", "try", "{", "InputStream", "content", "=", "hr", ".", "getContent", "(", ")", ";", "if", "(", "content", "!=", "null", ")"...
Creates an DbAccessException which specific type is determined by the response code in the http response. @param hr @return
[ "Creates", "an", "DbAccessException", "which", "specific", "type", "is", "determined", "by", "the", "response", "code", "in", "the", "http", "response", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/http/StdResponseHandler.java#L26-L52
train
helun/Ektorp
org.ektorp.spring/src/main/java/org/ektorp/spring/HttpClientFactoryBean.java
HttpClientFactoryBean.afterPropertiesSet
@Override public void afterPropertiesSet() throws Exception { if (couchDBProperties != null) { new DirectFieldAccessor(this).setPropertyValues(couchDBProperties); } LOG.info("Starting couchDb connector on {}:{}...", new Object[]{host,port}); LOG.debug("host: {}", host); LOG.debug("port: {}", port); LOG...
java
@Override public void afterPropertiesSet() throws Exception { if (couchDBProperties != null) { new DirectFieldAccessor(this).setPropertyValues(couchDBProperties); } LOG.info("Starting couchDb connector on {}:{}...", new Object[]{host,port}); LOG.debug("host: {}", host); LOG.debug("port: {}", port); LOG...
[ "@", "Override", "public", "void", "afterPropertiesSet", "(", ")", "throws", "Exception", "{", "if", "(", "couchDBProperties", "!=", "null", ")", "{", "new", "DirectFieldAccessor", "(", "this", ")", ".", "setPropertyValues", "(", "couchDBProperties", ")", ";", ...
Create the couchDB connection when starting the bean factory
[ "Create", "the", "couchDB", "connection", "when", "starting", "the", "bean", "factory" ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp.spring/src/main/java/org/ektorp/spring/HttpClientFactoryBean.java#L177-L221
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/support/SimpleViewGenerator.java
SimpleViewGenerator.generateViews
public Map<String, DesignDocument.View> generateViews( final Object repository) { final Map<String, DesignDocument.View> views = new HashMap<String, DesignDocument.View>(); final Class<?> repositoryClass = repository.getClass(); final Class<?> handledType = repository instanceof CouchDbRepositorySupport<?> ? ...
java
public Map<String, DesignDocument.View> generateViews( final Object repository) { final Map<String, DesignDocument.View> views = new HashMap<String, DesignDocument.View>(); final Class<?> repositoryClass = repository.getClass(); final Class<?> handledType = repository instanceof CouchDbRepositorySupport<?> ? ...
[ "public", "Map", "<", "String", ",", "DesignDocument", ".", "View", ">", "generateViews", "(", "final", "Object", "repository", ")", "{", "final", "Map", "<", "String", ",", "DesignDocument", ".", "View", ">", "views", "=", "new", "HashMap", "<", "String",...
Generates views based on annotations found in a repository class. If the repository class extends org.ektorp.support.CouchDbRepositorySupport its handled type will also examined for annotations eligible for view generation. @param repository @return a Map with generated views.
[ "Generates", "views", "based", "on", "annotations", "found", "in", "a", "repository", "class", ".", "If", "the", "repository", "class", "extends", "org", ".", "ektorp", ".", "support", ".", "CouchDbRepositorySupport", "its", "handled", "type", "will", "also", ...
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/support/SimpleViewGenerator.java#L89-L112
train
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/support/DesignDocument.java
DesignDocument.mergeWith
public boolean mergeWith(DesignDocument dd, boolean updateOnDiff) { boolean changed = mergeViews(dd.views(), updateOnDiff); changed = mergeFunctions(lists(), dd.lists(), updateOnDiff) || changed; changed = mergeFunctions(shows(), dd.shows(), updateOnDiff) || changed; changed = mergeFunct...
java
public boolean mergeWith(DesignDocument dd, boolean updateOnDiff) { boolean changed = mergeViews(dd.views(), updateOnDiff); changed = mergeFunctions(lists(), dd.lists(), updateOnDiff) || changed; changed = mergeFunctions(shows(), dd.shows(), updateOnDiff) || changed; changed = mergeFunct...
[ "public", "boolean", "mergeWith", "(", "DesignDocument", "dd", ",", "boolean", "updateOnDiff", ")", "{", "boolean", "changed", "=", "mergeViews", "(", "dd", ".", "views", "(", ")", ",", "updateOnDiff", ")", ";", "changed", "=", "mergeFunctions", "(", "lists"...
Merge this design document with the specified document, the result being stored in this design document. @param dd the design document to merge with @param updateOnDiff true to overwrite existing views/functions in this document with the views/functions in the specified document; false will only add new views/function...
[ "Merge", "this", "design", "document", "with", "the", "specified", "document", "the", "result", "being", "stored", "in", "this", "design", "document", "." ]
b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/support/DesignDocument.java#L199-L206
train
apache/incubator-atlas
typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java
HierarchicalType.isSubType
public boolean isSubType(String typeName) throws AtlasException { HierarchicalType cType = typeSystem.getDataType(HierarchicalType.class, typeName); return (cType == this || cType.superTypePaths.containsKey(getName())); }
java
public boolean isSubType(String typeName) throws AtlasException { HierarchicalType cType = typeSystem.getDataType(HierarchicalType.class, typeName); return (cType == this || cType.superTypePaths.containsKey(getName())); }
[ "public", "boolean", "isSubType", "(", "String", "typeName", ")", "throws", "AtlasException", "{", "HierarchicalType", "cType", "=", "typeSystem", ".", "getDataType", "(", "HierarchicalType", ".", "class", ",", "typeName", ")", ";", "return", "(", "cType", "==",...
Given type must be a SubType of this type. @param typeName @throws AtlasException
[ "Given", "type", "must", "be", "a", "SubType", "of", "this", "type", "." ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java#L111-L114
train
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java
HBaseBasedAuditRepository.listEvents
public List<EntityAuditEvent> listEvents(String entityId, String startKey, short n) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Listing events for entity id {}, starting timestamp {}, #records {}", entityId, startKey, n); } Table table = null; ...
java
public List<EntityAuditEvent> listEvents(String entityId, String startKey, short n) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Listing events for entity id {}, starting timestamp {}, #records {}", entityId, startKey, n); } Table table = null; ...
[ "public", "List", "<", "EntityAuditEvent", ">", "listEvents", "(", "String", "entityId", ",", "String", "startKey", ",", "short", "n", ")", "throws", "AtlasException", "{", "if", "(", "LOG", ".", "isDebugEnabled", "(", ")", ")", "{", "LOG", ".", "debug", ...
List events for the given entity id in decreasing order of timestamp, from the given startKey. Returns n results @param entityId entity id @param startKey key for the first event to be returned, used for pagination @param n number of events to be returned @return list of events @throws AtlasException
[ "List", "events", "for", "the", "given", "entity", "id", "in", "decreasing", "order", "of", "timestamp", "from", "the", "given", "startKey", ".", "Returns", "n", "results" ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java#L176-L241
train
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java
HBaseBasedAuditRepository.getHBaseConfiguration
public static org.apache.hadoop.conf.Configuration getHBaseConfiguration(Configuration atlasConf) throws AtlasException { Configuration subsetAtlasConf = ApplicationProperties.getSubsetConfiguration(atlasConf, CONFIG_PREFIX); org.apache.hadoop.conf.Configuration hbaseConf = HBaseConfigur...
java
public static org.apache.hadoop.conf.Configuration getHBaseConfiguration(Configuration atlasConf) throws AtlasException { Configuration subsetAtlasConf = ApplicationProperties.getSubsetConfiguration(atlasConf, CONFIG_PREFIX); org.apache.hadoop.conf.Configuration hbaseConf = HBaseConfigur...
[ "public", "static", "org", ".", "apache", ".", "hadoop", ".", "conf", ".", "Configuration", "getHBaseConfiguration", "(", "Configuration", "atlasConf", ")", "throws", "AtlasException", "{", "Configuration", "subsetAtlasConf", "=", "ApplicationProperties", ".", "getSub...
Converts atlas' application properties to hadoop conf @return @throws AtlasException @param atlasConf
[ "Converts", "atlas", "application", "properties", "to", "hadoop", "conf" ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java#L325-L335
train
apache/incubator-atlas
graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java
GraphDbObjectFactory.createEdge
public static Titan0Edge createEdge(Titan0Graph graph, Edge source) { if (source == null) { return null; } return new Titan0Edge(graph, source); }
java
public static Titan0Edge createEdge(Titan0Graph graph, Edge source) { if (source == null) { return null; } return new Titan0Edge(graph, source); }
[ "public", "static", "Titan0Edge", "createEdge", "(", "Titan0Graph", "graph", ",", "Edge", "source", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "Titan0Edge", "(", "graph", ",", "source", ")", ";", ...
Creates a Titan0Edge that corresponds to the given Gremlin Edge. @param graph The graph the edge should be created in @param source The gremlin edge
[ "Creates", "a", "Titan0Edge", "that", "corresponds", "to", "the", "given", "Gremlin", "Edge", "." ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java#L47-L53
train
apache/incubator-atlas
graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java
GraphDbObjectFactory.createVertex
public static Titan0Vertex createVertex(Titan0Graph graph, Vertex source) { if (source == null) { return null; } return new Titan0Vertex(graph, source); }
java
public static Titan0Vertex createVertex(Titan0Graph graph, Vertex source) { if (source == null) { return null; } return new Titan0Vertex(graph, source); }
[ "public", "static", "Titan0Vertex", "createVertex", "(", "Titan0Graph", "graph", ",", "Vertex", "source", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "Titan0Vertex", "(", "graph", ",", "source", ")", ...
Creates a Titan0Vertex that corresponds to the given Gremlin Vertex. @param graph The graph that contains the vertex @param source the Gremlin vertex
[ "Creates", "a", "Titan0Vertex", "that", "corresponds", "to", "the", "given", "Gremlin", "Vertex", "." ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java#L71-L77
train
apache/incubator-atlas
webapp/src/main/java/org/apache/atlas/web/params/AbstractParam.java
AbstractParam.errorMessage
protected String errorMessage(String input, Exception e) { return String.format("Invalid parameter: %s (%s)", input, e.getMessage()); }
java
protected String errorMessage(String input, Exception e) { return String.format("Invalid parameter: %s (%s)", input, e.getMessage()); }
[ "protected", "String", "errorMessage", "(", "String", "input", ",", "Exception", "e", ")", "{", "return", "String", ".", "format", "(", "\"Invalid parameter: %s (%s)\"", ",", "input", ",", "e", ".", "getMessage", "(", ")", ")", ";", "}" ]
Given a string representation which was unable to be parsed and the exception thrown, produce an entity to be sent to the client. @param input the raw input value @param e the exception thrown while parsing {@code input} @return the error message to be sent the client
[ "Given", "a", "string", "representation", "which", "was", "unable", "to", "be", "parsed", "and", "the", "exception", "thrown", "produce", "an", "entity", "to", "be", "sent", "to", "the", "client", "." ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/params/AbstractParam.java#L82-L84
train