id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1,900 | opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/EsperTemplate.java | EsperTemplate.configureEPServiceProvider | private void configureEPServiceProvider() throws EPException, IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Configuring the Esper Service Provider with name: " + name);
}
if (this.configuration != null && this.configuration.exists()) {
Configuration esperConfigurat... | java | private void configureEPServiceProvider() throws EPException, IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Configuring the Esper Service Provider with name: " + name);
}
if (this.configuration != null && this.configuration.exists()) {
Configuration esperConfigurat... | [
"private",
"void",
"configureEPServiceProvider",
"(",
")",
"throws",
"EPException",
",",
"IOException",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Configuring the Esper Service Provider with name: \"",
"+",
"name",... | Configure the Esper Service Provider to create the appropriate Esper
Runtime.
@throws IOException
@throws EPException | [
"Configure",
"the",
"Esper",
"Service",
"Provider",
"to",
"create",
"the",
"appropriate",
"Esper",
"Runtime",
"."
] | a88c9fd0301a4d6962da70d85577c27d50d08825 | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/EsperTemplate.java#L171-L186 |
1,901 | ksclarke/freelib-utils | src/main/java/info/freelibrary/maven/MavenUtils.java | MavenUtils.setLogLevels | public static void setLogLevels(final int aLogLevel, final String[] aLoggerList, final String[] aExcludesList,
final String... aIncludesList) {
final ArrayList<String> loggerList = new ArrayList<>(Arrays.asList(aLoggerList));
final Class<? extends Logger> simpleLogger = LoggerFactory.getLogg... | java | public static void setLogLevels(final int aLogLevel, final String[] aLoggerList, final String[] aExcludesList,
final String... aIncludesList) {
final ArrayList<String> loggerList = new ArrayList<>(Arrays.asList(aLoggerList));
final Class<? extends Logger> simpleLogger = LoggerFactory.getLogg... | [
"public",
"static",
"void",
"setLogLevels",
"(",
"final",
"int",
"aLogLevel",
",",
"final",
"String",
"[",
"]",
"aLoggerList",
",",
"final",
"String",
"[",
"]",
"aExcludesList",
",",
"final",
"String",
"...",
"aIncludesList",
")",
"{",
"final",
"ArrayList",
... | Sets the logging level of the supplied loggers, optionally excluding some and including others.
@param aLogLevel A log level to set in the supplied loggers
@param aLoggerList A list of names of loggers to have their levels reset
@param aExcludesList A list of names of loggers to exclude from the reset
@param aIncludes... | [
"Sets",
"the",
"logging",
"level",
"of",
"the",
"supplied",
"loggers",
"optionally",
"excluding",
"some",
"and",
"including",
"others",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/maven/MavenUtils.java#L54-L100 |
1,902 | ksclarke/freelib-utils | src/main/java/info/freelibrary/maven/MavenUtils.java | MavenUtils.getLevelIntCode | public static int getLevelIntCode(final String aLogLevelName) {
final String levelName = aLogLevelName.trim().toLowerCase(Locale.US);
if ("error".equals(levelName)) {
return ERROR_LOG_LEVEL;
} else if ("warn".equals(levelName)) {
return WARN_LOG_LEVEL;
} else if ... | java | public static int getLevelIntCode(final String aLogLevelName) {
final String levelName = aLogLevelName.trim().toLowerCase(Locale.US);
if ("error".equals(levelName)) {
return ERROR_LOG_LEVEL;
} else if ("warn".equals(levelName)) {
return WARN_LOG_LEVEL;
} else if ... | [
"public",
"static",
"int",
"getLevelIntCode",
"(",
"final",
"String",
"aLogLevelName",
")",
"{",
"final",
"String",
"levelName",
"=",
"aLogLevelName",
".",
"trim",
"(",
")",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"if",
"(",
"\"error\"",
".... | Returns the int of the supplied log level or zero if the supplied name doesn't match a known log level.
@param aLogLevelName The name (error, warn, info, debug, or trace) of a logging level
@return The int code of the supplied level or zero if the supplied name doesn't correspond to a known level | [
"Returns",
"the",
"int",
"of",
"the",
"supplied",
"log",
"level",
"or",
"zero",
"if",
"the",
"supplied",
"name",
"doesn",
"t",
"match",
"a",
"known",
"log",
"level",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/maven/MavenUtils.java#L152-L168 |
1,903 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/URLUtils.java | URLUtils.decode | public static String decode(final String aURL, final String aEncoding) {
String urlString = aURL;
String decodedString;
try {
do {
decodedString = urlString;
// Java's URLDecoder needs a little help with occurrences of '%' that aren't percent escaped... | java | public static String decode(final String aURL, final String aEncoding) {
String urlString = aURL;
String decodedString;
try {
do {
decodedString = urlString;
// Java's URLDecoder needs a little help with occurrences of '%' that aren't percent escaped... | [
"public",
"static",
"String",
"decode",
"(",
"final",
"String",
"aURL",
",",
"final",
"String",
"aEncoding",
")",
"{",
"String",
"urlString",
"=",
"aURL",
";",
"String",
"decodedString",
";",
"try",
"{",
"do",
"{",
"decodedString",
"=",
"urlString",
";",
"... | Decodes an encoded path. If it has been doubly encoded, it is doubly decoded.
@param aURL An encoded URL String
@param aEncoding A character encoding to use for the string decoding
@return A decoded URL String | [
"Decodes",
"an",
"encoded",
"path",
".",
"If",
"it",
"has",
"been",
"doubly",
"encoded",
"it",
"is",
"doubly",
"decoded",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/URLUtils.java#L125-L145 |
1,904 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/URLUtils.java | URLUtils.encode | public static String encode(final String aString, final boolean aIgnoreSlashFlag) {
final CharacterIterator iterator = new StringCharacterIterator(decode(aString));
final StringBuilder builder = new StringBuilder();
for (char c = iterator.first(); c != CharacterIterator.DONE; c = iterator.next(... | java | public static String encode(final String aString, final boolean aIgnoreSlashFlag) {
final CharacterIterator iterator = new StringCharacterIterator(decode(aString));
final StringBuilder builder = new StringBuilder();
for (char c = iterator.first(); c != CharacterIterator.DONE; c = iterator.next(... | [
"public",
"static",
"String",
"encode",
"(",
"final",
"String",
"aString",
",",
"final",
"boolean",
"aIgnoreSlashFlag",
")",
"{",
"final",
"CharacterIterator",
"iterator",
"=",
"new",
"StringCharacterIterator",
"(",
"decode",
"(",
"aString",
")",
")",
";",
"fina... | Percent-encodes supplied string but only after decoding it completely first.
@param aString The string to encode
@param aIgnoreSlashFlag Whether slashes should be encoded or not
@return The percent-encoded string | [
"Percent",
"-",
"encodes",
"supplied",
"string",
"but",
"only",
"after",
"decoding",
"it",
"completely",
"first",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/URLUtils.java#L154-L193 |
1,905 | opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/EsperStatement.java | EsperStatement.start | public void start() {
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] being started");
}
this.epStatement.start();
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] started");
}
} | java | public void start() {
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] being started");
}
this.epStatement.start();
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] started");
}
} | [
"public",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Esper statement [\"",
"+",
"epl",
"+",
"\"] being started\"",
")",
";",
"}",
"this",
".",
"epStatement",
".",
"start",
"("... | Starts events being collated according to the statement's filter query | [
"Starts",
"events",
"being",
"collated",
"according",
"to",
"the",
"statement",
"s",
"filter",
"query"
] | a88c9fd0301a4d6962da70d85577c27d50d08825 | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/EsperStatement.java#L78-L88 |
1,906 | opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/EsperStatement.java | EsperStatement.stop | public void stop() {
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] being stopped");
}
this.epStatement.stop();
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] stopped");
}
} | java | public void stop() {
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] being stopped");
}
this.epStatement.stop();
if (LOG.isInfoEnabled()) {
LOG.info("Esper statement [" + epl + "] stopped");
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Esper statement [\"",
"+",
"epl",
"+",
"\"] being stopped\"",
")",
";",
"}",
"this",
".",
"epStatement",
".",
"stop",
"(",
... | Stops the underlying native statement from applying its filter query. | [
"Stops",
"the",
"underlying",
"native",
"statement",
"from",
"applying",
"its",
"filter",
"query",
"."
] | a88c9fd0301a4d6962da70d85577c27d50d08825 | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/EsperStatement.java#L93-L103 |
1,907 | opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/EsperStatement.java | EsperStatement.addEPStatementListener | private void addEPStatementListener(UpdateListener listener) {
if (this.subscriber == null) {
if (epStatement != null) {
epStatement.addListener(listener);
}
}
} | java | private void addEPStatementListener(UpdateListener listener) {
if (this.subscriber == null) {
if (epStatement != null) {
epStatement.addListener(listener);
}
}
} | [
"private",
"void",
"addEPStatementListener",
"(",
"UpdateListener",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"subscriber",
"==",
"null",
")",
"{",
"if",
"(",
"epStatement",
"!=",
"null",
")",
"{",
"epStatement",
".",
"addListener",
"(",
"listener",
")",... | Adds an listener to the underlying native EPStatement.
@param listener
the listener to add | [
"Adds",
"an",
"listener",
"to",
"the",
"underlying",
"native",
"EPStatement",
"."
] | a88c9fd0301a4d6962da70d85577c27d50d08825 | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/EsperStatement.java#L170-L176 |
1,908 | opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/EsperStatement.java | EsperStatement.setEPStatement | void setEPStatement(EPStatement epStatement) {
this.epStatement = epStatement;
if (this.subscriber != null) {
epStatement.setSubscriber(this.subscriber);
} else {
for (UpdateListener listener : listeners) {
epStatement.addListener(listener);
}
}
} | java | void setEPStatement(EPStatement epStatement) {
this.epStatement = epStatement;
if (this.subscriber != null) {
epStatement.setSubscriber(this.subscriber);
} else {
for (UpdateListener listener : listeners) {
epStatement.addListener(listener);
}
}
} | [
"void",
"setEPStatement",
"(",
"EPStatement",
"epStatement",
")",
"{",
"this",
".",
"epStatement",
"=",
"epStatement",
";",
"if",
"(",
"this",
".",
"subscriber",
"!=",
"null",
")",
"{",
"epStatement",
".",
"setSubscriber",
"(",
"this",
".",
"subscriber",
")"... | Sets the native Esper statement. Typically created by an Esper Template.
@param epStatement
the underlying native Esper statement
@see org.opencredo.esper.EsperTemplate | [
"Sets",
"the",
"native",
"Esper",
"statement",
".",
"Typically",
"created",
"by",
"an",
"Esper",
"Template",
"."
] | a88c9fd0301a4d6962da70d85577c27d50d08825 | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/EsperStatement.java#L185-L194 |
1,909 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileExtFileFilter.java | FileExtFileFilter.filters | public boolean filters(final String aFileExt) {
final String normalizedExt = normalizeExt(aFileExt);
for (final String extension : myExtensions) {
if (extension.equals(normalizedExt)) {
return true;
}
}
return false;
} | java | public boolean filters(final String aFileExt) {
final String normalizedExt = normalizeExt(aFileExt);
for (final String extension : myExtensions) {
if (extension.equals(normalizedExt)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"filters",
"(",
"final",
"String",
"aFileExt",
")",
"{",
"final",
"String",
"normalizedExt",
"=",
"normalizeExt",
"(",
"aFileExt",
")",
";",
"for",
"(",
"final",
"String",
"extension",
":",
"myExtensions",
")",
"{",
"if",
"(",
"extension... | Returns whether or not the supplied file extension is one that this filter matches.
@param aFileExt A file extension like: jpg, gif, jp2, txt, xml, etc.
@return True if this filter matches files with the supplied extension | [
"Returns",
"whether",
"or",
"not",
"the",
"supplied",
"file",
"extension",
"is",
"one",
"that",
"this",
"filter",
"matches",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileExtFileFilter.java#L77-L87 |
1,910 | opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/config/xml/EsperListenerParser.java | EsperListenerParser.parseListeners | @SuppressWarnings("unchecked")
public ManagedSet parseListeners(Element element, ParserContext parserContext) {
ManagedSet listeners = new ManagedSet();
NodeList childNodes = element.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(... | java | @SuppressWarnings("unchecked")
public ManagedSet parseListeners(Element element, ParserContext parserContext) {
ManagedSet listeners = new ManagedSet();
NodeList childNodes = element.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"ManagedSet",
"parseListeners",
"(",
"Element",
"element",
",",
"ParserContext",
"parserContext",
")",
"{",
"ManagedSet",
"listeners",
"=",
"new",
"ManagedSet",
"(",
")",
";",
"NodeList",
"childNodes",
... | Parses out a set of configured esper statement listeners.
@param element
the esper listeners element
@param parserContext
the parser's current context
@return a list of configured esper statement listeners | [
"Parses",
"out",
"a",
"set",
"of",
"configured",
"esper",
"statement",
"listeners",
"."
] | a88c9fd0301a4d6962da70d85577c27d50d08825 | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/config/xml/EsperListenerParser.java#L48-L68 |
1,911 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final long aLongDetail) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, Long.toString(aLongDetail)));
} | java | protected String getI18n(final String aMessageKey, final long aLongDetail) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, Long.toString(aLongDetail)));
} | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"long",
"aLongDetail",
")",
"{",
"return",
"StringUtils",
".",
"normalizeWS",
"(",
"myBundle",
".",
"get",
"(",
"aMessageKey",
",",
"Long",
".",
"toString",
"(",
"aLongDetai... | Gets the internationalized value for the supplied message key, using a long as additional information.
@param aMessageKey A message key
@param aLongDetail Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"a",
"long",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L57-L59 |
1,912 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final int aIntDetail) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, Integer.toString(aIntDetail)));
} | java | protected String getI18n(final String aMessageKey, final int aIntDetail) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, Integer.toString(aIntDetail)));
} | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"int",
"aIntDetail",
")",
"{",
"return",
"StringUtils",
".",
"normalizeWS",
"(",
"myBundle",
".",
"get",
"(",
"aMessageKey",
",",
"Integer",
".",
"toString",
"(",
"aIntDetai... | Gets the internationalized value for the supplied message key, using an int as additional information.
@param aMessageKey A message key
@param aIntDetail Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"an",
"int",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L68-L70 |
1,913 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final String aDetail) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aDetail));
} | java | protected String getI18n(final String aMessageKey, final String aDetail) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aDetail));
} | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"String",
"aDetail",
")",
"{",
"return",
"StringUtils",
".",
"normalizeWS",
"(",
"myBundle",
".",
"get",
"(",
"aMessageKey",
",",
"aDetail",
")",
")",
";",
"}"
] | Gets the internationalized value for the supplied message key, using a string as additional information.
@param aMessageKey A message key
@param aDetail Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"a",
"string",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L79-L81 |
1,914 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final String... aDetailsArray) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aDetailsArray));
} | java | protected String getI18n(final String aMessageKey, final String... aDetailsArray) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aDetailsArray));
} | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"String",
"...",
"aDetailsArray",
")",
"{",
"return",
"StringUtils",
".",
"normalizeWS",
"(",
"myBundle",
".",
"get",
"(",
"aMessageKey",
",",
"aDetailsArray",
")",
")",
";"... | Gets the internationalized value for the supplied message key, using a string array as additional information.
@param aMessageKey A message key
@param aDetailsArray Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"a",
"string",
"array",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L90-L92 |
1,915 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final Exception aException) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aException.getMessage()));
} | java | protected String getI18n(final String aMessageKey, final Exception aException) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aException.getMessage()));
} | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"Exception",
"aException",
")",
"{",
"return",
"StringUtils",
".",
"normalizeWS",
"(",
"myBundle",
".",
"get",
"(",
"aMessageKey",
",",
"aException",
".",
"getMessage",
"(",
... | Gets the internationalized value for the supplied message key, using an exception as additional information.
@param aMessageKey A message key
@param aException Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"an",
"exception",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L101-L103 |
1,916 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final File aFile) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aFile.getAbsolutePath()));
} | java | protected String getI18n(final String aMessageKey, final File aFile) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, aFile.getAbsolutePath()));
} | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"File",
"aFile",
")",
"{",
"return",
"StringUtils",
".",
"normalizeWS",
"(",
"myBundle",
".",
"get",
"(",
"aMessageKey",
",",
"aFile",
".",
"getAbsolutePath",
"(",
")",
")... | Gets the internationalized value for the supplied message key, using a file as additional information.
@param aMessageKey A message key
@param aFile Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"a",
"file",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L112-L114 |
1,917 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final File... aFileArray) {
final String[] fileNames = new String[aFileArray.length];
for (int index = 0; index < fileNames.length; index++) {
fileNames[index] = aFileArray[index].getAbsolutePath();
}
return StringUtils.nor... | java | protected String getI18n(final String aMessageKey, final File... aFileArray) {
final String[] fileNames = new String[aFileArray.length];
for (int index = 0; index < fileNames.length; index++) {
fileNames[index] = aFileArray[index].getAbsolutePath();
}
return StringUtils.nor... | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"File",
"...",
"aFileArray",
")",
"{",
"final",
"String",
"[",
"]",
"fileNames",
"=",
"new",
"String",
"[",
"aFileArray",
".",
"length",
"]",
";",
"for",
"(",
"int",
"... | Gets the internationalized value for the supplied message key, using a file array as additional information.
@param aMessageKey A message key
@param aFileArray Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"a",
"file",
"array",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L123-L131 |
1,918 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final Object... aObjArray) {
final String[] strings = new String[aObjArray.length];
for (int index = 0; index < aObjArray.length; index++) {
if (aObjArray[index] instanceof File) {
strings[index] = ((File) aObjArray[index]).... | java | protected String getI18n(final String aMessageKey, final Object... aObjArray) {
final String[] strings = new String[aObjArray.length];
for (int index = 0; index < aObjArray.length; index++) {
if (aObjArray[index] instanceof File) {
strings[index] = ((File) aObjArray[index]).... | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"Object",
"...",
"aObjArray",
")",
"{",
"final",
"String",
"[",
"]",
"strings",
"=",
"new",
"String",
"[",
"aObjArray",
".",
"length",
"]",
";",
"for",
"(",
"int",
"in... | Gets the internationalized value for the supplied message key, using an object array as additional information.
@param aMessageKey A message key
@param aObjArray Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"an",
"object",
"array",
"as",
"additional",
"information",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L140-L152 |
1,919 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.hasI18nKey | protected boolean hasI18nKey(final String aMessageKey) {
return myBundle != null && aMessageKey != null && myBundle.containsKey(aMessageKey);
} | java | protected boolean hasI18nKey(final String aMessageKey) {
return myBundle != null && aMessageKey != null && myBundle.containsKey(aMessageKey);
} | [
"protected",
"boolean",
"hasI18nKey",
"(",
"final",
"String",
"aMessageKey",
")",
"{",
"return",
"myBundle",
"!=",
"null",
"&&",
"aMessageKey",
"!=",
"null",
"&&",
"myBundle",
".",
"containsKey",
"(",
"aMessageKey",
")",
";",
"}"
] | Returns true if this I18N object contains the requested I18N key; else, false.
@param aMessageKey A key to check to see if it exists
@return True if the key exists; else, false | [
"Returns",
"true",
"if",
"this",
"I18N",
"object",
"contains",
"the",
"requested",
"I18N",
"key",
";",
"else",
"false",
"."
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L160-L162 |
1,920 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/ClasspathUtils.java | ClasspathUtils.getDirs | public static String[] getDirs() {
final ArrayList<String> list = new ArrayList<>();
for (final String filename : System.getProperty(CLASSPATH).split(DELIMETER)) {
final File file = new File(filename);
LOGGER.debug(MessageCodes.UTIL_003, file, file.isDirectory() ? YES : NO);
... | java | public static String[] getDirs() {
final ArrayList<String> list = new ArrayList<>();
for (final String filename : System.getProperty(CLASSPATH).split(DELIMETER)) {
final File file = new File(filename);
LOGGER.debug(MessageCodes.UTIL_003, file, file.isDirectory() ? YES : NO);
... | [
"public",
"static",
"String",
"[",
"]",
"getDirs",
"(",
")",
"{",
"final",
"ArrayList",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"String",
"filename",
":",
"System",
".",
"getProperty",
"(",
"CLASSP... | Returns an String array of all the directory names in the system classpath
@return The names of directories from the system classpath | [
"Returns",
"an",
"String",
"array",
"of",
"all",
"the",
"directory",
"names",
"in",
"the",
"system",
"classpath"
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/ClasspathUtils.java#L39-L53 |
1,921 | ksclarke/freelib-utils | src/main/java/info/freelibrary/util/ClasspathUtils.java | ClasspathUtils.getJars | public static String[] getJars() {
final ArrayList<String> list = new ArrayList<>();
final FileExtFileFilter filter = new FileExtFileFilter(JAR_EXT);
for (final String part : System.getProperty(CLASSPATH).split(File.pathSeparator)) {
final File file = new File(part);
if... | java | public static String[] getJars() {
final ArrayList<String> list = new ArrayList<>();
final FileExtFileFilter filter = new FileExtFileFilter(JAR_EXT);
for (final String part : System.getProperty(CLASSPATH).split(File.pathSeparator)) {
final File file = new File(part);
if... | [
"public",
"static",
"String",
"[",
"]",
"getJars",
"(",
")",
"{",
"final",
"ArrayList",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"FileExtFileFilter",
"filter",
"=",
"new",
"FileExtFileFilter",
"(",
"JAR_EXT",
")",
... | Returns an String array of all the names of the jars in the system classpath
@return The names of jars from the system classpath | [
"Returns",
"an",
"String",
"array",
"of",
"all",
"the",
"names",
"of",
"the",
"jars",
"in",
"the",
"system",
"classpath"
] | 54e822ae4c11b3d74793fd82a1a535ffafffaf45 | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/ClasspathUtils.java#L126-L139 |
1,922 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipCall.java | SipCall.initiateOutgoingMessage | public boolean initiateOutgoingMessage(String toUri, String viaNonProxyRoute) {
return initiateOutgoingMessage(null, toUri, viaNonProxyRoute, null, null, null);
} | java | public boolean initiateOutgoingMessage(String toUri, String viaNonProxyRoute) {
return initiateOutgoingMessage(null, toUri, viaNonProxyRoute, null, null, null);
} | [
"public",
"boolean",
"initiateOutgoingMessage",
"(",
"String",
"toUri",
",",
"String",
"viaNonProxyRoute",
")",
"{",
"return",
"initiateOutgoingMessage",
"(",
"null",
",",
"toUri",
",",
"viaNonProxyRoute",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | This basic method is used to initiate an outgoing MESSAGE.
<p>
This method returns when the request message has been sent out. Your calling program must
subsequently call the waitOutgoingMessageResponse() method (one or more times) to get the
result(s).
<p>
If a DIALOG exists the method will use it to send the MESSAG... | [
"This",
"basic",
"method",
"is",
"used",
"to",
"initiate",
"an",
"outgoing",
"MESSAGE",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L746-L748 |
1,923 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipCall.java | SipCall.findMostRecentResponse | public SipResponse findMostRecentResponse(int statusCode) {
List<SipResponse> responses = getAllReceivedResponses();
ListIterator<SipResponse> i = responses.listIterator(responses.size());
while (i.hasPrevious()) {
SipResponse resp = i.previous();
if (resp.getStatusCode() == statusCode) {
... | java | public SipResponse findMostRecentResponse(int statusCode) {
List<SipResponse> responses = getAllReceivedResponses();
ListIterator<SipResponse> i = responses.listIterator(responses.size());
while (i.hasPrevious()) {
SipResponse resp = i.previous();
if (resp.getStatusCode() == statusCode) {
... | [
"public",
"SipResponse",
"findMostRecentResponse",
"(",
"int",
"statusCode",
")",
"{",
"List",
"<",
"SipResponse",
">",
"responses",
"=",
"getAllReceivedResponses",
"(",
")",
";",
"ListIterator",
"<",
"SipResponse",
">",
"i",
"=",
"responses",
".",
"listIterator",... | Finds the last received response with status code matching the given parameter.
@param statusCode Indicates the type of response to return.
@return SipResponse object or null, if not found. | [
"Finds",
"the",
"last",
"received",
"response",
"with",
"status",
"code",
"matching",
"the",
"given",
"parameter",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L2973-L2985 |
1,924 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipSession.java | SipSession.generateNewTag | public String generateNewTag() {
// This scheme of using random numbers to generate a
// unique tag has a small probability of
// causing duplicate tags.
// TODO at some point, we may want to change it.
int r = parent.getRandom().nextInt();
r = (r < 0) ? 0 - r : r; // generate a positive number... | java | public String generateNewTag() {
// This scheme of using random numbers to generate a
// unique tag has a small probability of
// causing duplicate tags.
// TODO at some point, we may want to change it.
int r = parent.getRandom().nextInt();
r = (r < 0) ? 0 - r : r; // generate a positive number... | [
"public",
"String",
"generateNewTag",
"(",
")",
"{",
"// This scheme of using random numbers to generate a",
"// unique tag has a small probability of",
"// causing duplicate tags.",
"// TODO at some point, we may want to change it.",
"int",
"r",
"=",
"parent",
".",
"getRandom",
"(",... | Generates a newly generated unique tag ID.
@return A String tag ID | [
"Generates",
"a",
"newly",
"generated",
"unique",
"tag",
"ID",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipSession.java#L290-L304 |
1,925 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipSession.java | SipSession.sendRequestWithTransaction | public SipTransaction sendRequestWithTransaction(String reqMessage, boolean viaProxy,
Dialog dialog) throws ParseException {
Request request = parent.getMessageFactory().createRequest(reqMessage);
return sendRequestWithTransaction(request, viaProxy, dialog);
} | java | public SipTransaction sendRequestWithTransaction(String reqMessage, boolean viaProxy,
Dialog dialog) throws ParseException {
Request request = parent.getMessageFactory().createRequest(reqMessage);
return sendRequestWithTransaction(request, viaProxy, dialog);
} | [
"public",
"SipTransaction",
"sendRequestWithTransaction",
"(",
"String",
"reqMessage",
",",
"boolean",
"viaProxy",
",",
"Dialog",
"dialog",
")",
"throws",
"ParseException",
"{",
"Request",
"request",
"=",
"parent",
".",
"getMessageFactory",
"(",
")",
".",
"createReq... | This basic method sends out a request message as part of a transaction. A test program should
use this method when a response to a request is expected. A Request object is constructed from
the string passed in.
<p>
This method returns when the request message has been sent out. The calling program must
subsequently ca... | [
"This",
"basic",
"method",
"sends",
"out",
"a",
"request",
"message",
"as",
"part",
"of",
"a",
"transaction",
".",
"A",
"test",
"program",
"should",
"use",
"this",
"method",
"when",
"a",
"response",
"to",
"a",
"request",
"is",
"expected",
".",
"A",
"Requ... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipSession.java#L826-L830 |
1,926 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipSession.java | SipSession.sendRequestWithTransaction | public SipTransaction sendRequestWithTransaction(Request request, boolean viaProxy,
Dialog dialog) {
return sendRequestWithTransaction(request, viaProxy, dialog, null);
} | java | public SipTransaction sendRequestWithTransaction(Request request, boolean viaProxy,
Dialog dialog) {
return sendRequestWithTransaction(request, viaProxy, dialog, null);
} | [
"public",
"SipTransaction",
"sendRequestWithTransaction",
"(",
"Request",
"request",
",",
"boolean",
"viaProxy",
",",
"Dialog",
"dialog",
")",
"{",
"return",
"sendRequestWithTransaction",
"(",
"request",
",",
"viaProxy",
",",
"dialog",
",",
"null",
")",
";",
"}"
] | This basic method sends out a request message as part of a transaction. A test program should
use this method when a response to a request is expected. The Request object passed in must be
a fully formed Request with all required content, EXCEPT for the Via header branch parameter,
which cannot be filled in until a cli... | [
"This",
"basic",
"method",
"sends",
"out",
"a",
"request",
"message",
"as",
"part",
"of",
"a",
"transaction",
".",
"A",
"test",
"program",
"should",
"use",
"this",
"method",
"when",
"a",
"response",
"to",
"a",
"request",
"is",
"expected",
".",
"The",
"Re... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipSession.java#L935-L938 |
1,927 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipSession.java | SipSession.sendUnidirectionalResponse | public boolean sendUnidirectionalResponse(RequestEvent request, int statusCode,
String reasonPhrase, String toTag, Address contact, int expires) {
initErrorInfo();
if ((request == null) || (request.getRequest() == null)) {
setErrorMessage("Cannot send response, request information is null");
... | java | public boolean sendUnidirectionalResponse(RequestEvent request, int statusCode,
String reasonPhrase, String toTag, Address contact, int expires) {
initErrorInfo();
if ((request == null) || (request.getRequest() == null)) {
setErrorMessage("Cannot send response, request information is null");
... | [
"public",
"boolean",
"sendUnidirectionalResponse",
"(",
"RequestEvent",
"request",
",",
"int",
"statusCode",
",",
"String",
"reasonPhrase",
",",
"String",
"toTag",
",",
"Address",
"contact",
",",
"int",
"expires",
")",
"{",
"initErrorInfo",
"(",
")",
";",
"if",
... | This method sends out a stateless response to the given request.
@param request The RequestEvent object that contains the request we are responding to.
@param statusCode The status code of the response to send (may use SipResponse constants).
@param reasonPhrase If not null, the reason phrase to send.
@param toTag If ... | [
"This",
"method",
"sends",
"out",
"a",
"stateless",
"response",
"to",
"the",
"given",
"request",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipSession.java#L1722-L1761 |
1,928 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipTransaction.java | SipTransaction.getRequest | public Request getRequest() {
if (clientTransaction != null) {
return clientTransaction.getRequest();
}
if (serverTransaction != null) {
return serverTransaction.getRequest();
}
return null;
} | java | public Request getRequest() {
if (clientTransaction != null) {
return clientTransaction.getRequest();
}
if (serverTransaction != null) {
return serverTransaction.getRequest();
}
return null;
} | [
"public",
"Request",
"getRequest",
"(",
")",
"{",
"if",
"(",
"clientTransaction",
"!=",
"null",
")",
"{",
"return",
"clientTransaction",
".",
"getRequest",
"(",
")",
";",
"}",
"if",
"(",
"serverTransaction",
"!=",
"null",
")",
"{",
"return",
"serverTransacti... | The user test program MAY call this method to view the javax.sip.message.Request object that
created this transaction. However, knowledge of JAIN SIP API is required to interpret the
Request object.
@return Returns the javax.sip.message.Request object that created this transaction. | [
"The",
"user",
"test",
"program",
"MAY",
"call",
"this",
"method",
"to",
"view",
"the",
"javax",
".",
"sip",
".",
"message",
".",
"Request",
"object",
"that",
"created",
"this",
"transaction",
".",
"However",
"knowledge",
"of",
"JAIN",
"SIP",
"API",
"is",
... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipTransaction.java#L128-L138 |
1,929 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertLastOperationSuccess | public static void assertLastOperationSuccess(String msg, SipActionObject op) {
assertNotNull("Null assert object passed in", op);
assertTrue(msg, op.getErrorMessage().length() == 0);
} | java | public static void assertLastOperationSuccess(String msg, SipActionObject op) {
assertNotNull("Null assert object passed in", op);
assertTrue(msg, op.getErrorMessage().length() == 0);
} | [
"public",
"static",
"void",
"assertLastOperationSuccess",
"(",
"String",
"msg",
",",
"SipActionObject",
"op",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"op",
")",
";",
"assertTrue",
"(",
"msg",
",",
"op",
".",
"getErrorMessage",
"(",... | Asserts that the last SIP operation performed by the given object was successful. Assertion
failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param op the SipUnit object that executed an operation. | [
"Asserts",
"that",
"the",
"last",
"SIP",
"operation",
"performed",
"by",
"the",
"given",
"object",
"was",
"successful",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L77-L80 |
1,930 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertHeaderPresent | public static void assertHeaderPresent(String msg, SipMessage sipMessage, String header) {
assertNotNull("Null assert object passed in", sipMessage);
assertTrue(msg, sipMessage.getHeaders(header).hasNext());
} | java | public static void assertHeaderPresent(String msg, SipMessage sipMessage, String header) {
assertNotNull("Null assert object passed in", sipMessage);
assertTrue(msg, sipMessage.getHeaders(header).hasNext());
} | [
"public",
"static",
"void",
"assertHeaderPresent",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
",",
"String",
"header",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"assertTrue",
"(",
"msg",
",",
"sipM... | Asserts that the given SIP message contains at least one occurrence of the specified header.
Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param sipMessage the SIP message.
@param header the string identifying the header as specified in RFC-3261. | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"at",
"least",
"one",
"occurrence",
"of",
"the",
"specified",
"header",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L123-L126 |
1,931 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertHeaderNotPresent | public static void assertHeaderNotPresent(String msg, SipMessage sipMessage, String header) {
assertNotNull("Null assert object passed in", sipMessage);
assertFalse(msg, sipMessage.getHeaders(header).hasNext());
} | java | public static void assertHeaderNotPresent(String msg, SipMessage sipMessage, String header) {
assertNotNull("Null assert object passed in", sipMessage);
assertFalse(msg, sipMessage.getHeaders(header).hasNext());
} | [
"public",
"static",
"void",
"assertHeaderNotPresent",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
",",
"String",
"header",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"assertFalse",
"(",
"msg",
",",
"... | Asserts that the given SIP message contains no occurrence of the specified header. Assertion
failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param sipMessage the SIP message.
@param header the string identifying the header as specified in RFC-3261. | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"no",
"occurrence",
"of",
"the",
"specified",
"header",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L146-L149 |
1,932 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertHeaderContains | public static void assertHeaderContains(SipMessage sipMessage, String header, String value) {
assertHeaderContains(null, sipMessage, header, value); // value is case
// sensitive?
} | java | public static void assertHeaderContains(SipMessage sipMessage, String header, String value) {
assertHeaderContains(null, sipMessage, header, value); // value is case
// sensitive?
} | [
"public",
"static",
"void",
"assertHeaderContains",
"(",
"SipMessage",
"sipMessage",
",",
"String",
"header",
",",
"String",
"value",
")",
"{",
"assertHeaderContains",
"(",
"null",
",",
"sipMessage",
",",
"header",
",",
"value",
")",
";",
"// value is case\r",
"... | Asserts that the given SIP message contains at least one occurrence of the specified header and
that at least one occurrence of this header contains the given value. The assertion fails if no
occurrence of the header contains the value or if the header is not present in the mesage.
@param sipMessage the SIP message.
@... | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"at",
"least",
"one",
"occurrence",
"of",
"the",
"specified",
"header",
"and",
"that",
"at",
"least",
"one",
"occurrence",
"of",
"this",
"header",
"contains",
"the",
"given",
"value",
".",
"The... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L162-L165 |
1,933 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertHeaderContains | public static void assertHeaderContains(String msg, SipMessage sipMessage, String header,
String value) {
assertNotNull("Null assert object passed in", sipMessage);
ListIterator<Header> l = sipMessage.getHeaders(header);
while (l.hasNext()) {
String h = ((Header) l.next()).toString();
... | java | public static void assertHeaderContains(String msg, SipMessage sipMessage, String header,
String value) {
assertNotNull("Null assert object passed in", sipMessage);
ListIterator<Header> l = sipMessage.getHeaders(header);
while (l.hasNext()) {
String h = ((Header) l.next()).toString();
... | [
"public",
"static",
"void",
"assertHeaderContains",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
",",
"String",
"header",
",",
"String",
"value",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"ListIterator... | Asserts that the given SIP message contains at least one occurrence of the specified header and
that at least one occurrence of this header contains the given value. The assertion fails if no
occurrence of the header contains the value or if the header is not present in the mesage.
Assertion failure output includes the... | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"at",
"least",
"one",
"occurrence",
"of",
"the",
"specified",
"header",
"and",
"that",
"at",
"least",
"one",
"occurrence",
"of",
"this",
"header",
"contains",
"the",
"given",
"value",
".",
"The... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L180-L194 |
1,934 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertHeaderNotContains | public static void assertHeaderNotContains(SipMessage sipMessage, String header, String value) {
assertHeaderNotContains(null, sipMessage, header, value);
} | java | public static void assertHeaderNotContains(SipMessage sipMessage, String header, String value) {
assertHeaderNotContains(null, sipMessage, header, value);
} | [
"public",
"static",
"void",
"assertHeaderNotContains",
"(",
"SipMessage",
"sipMessage",
",",
"String",
"header",
",",
"String",
"value",
")",
"{",
"assertHeaderNotContains",
"(",
"null",
",",
"sipMessage",
",",
"header",
",",
"value",
")",
";",
"}"
] | Asserts that the given SIP message contains no occurrence of the specified header with the
value given, or that there is no occurrence of the header in the message. The assertion fails
if any occurrence of the header contains the value.
@param sipMessage the SIP message.
@param header the string identifying the header... | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"no",
"occurrence",
"of",
"the",
"specified",
"header",
"with",
"the",
"value",
"given",
"or",
"that",
"there",
"is",
"no",
"occurrence",
"of",
"the",
"header",
"in",
"the",
"message",
".",
"... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L207-L209 |
1,935 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertResponseReceived | public static void assertResponseReceived(int statusCode, String method, long sequenceNumber,
MessageListener obj) {
assertResponseReceived(null, statusCode, method, sequenceNumber, obj);
} | java | public static void assertResponseReceived(int statusCode, String method, long sequenceNumber,
MessageListener obj) {
assertResponseReceived(null, statusCode, method, sequenceNumber, obj);
} | [
"public",
"static",
"void",
"assertResponseReceived",
"(",
"int",
"statusCode",
",",
"String",
"method",
",",
"long",
"sequenceNumber",
",",
"MessageListener",
"obj",
")",
"{",
"assertResponseReceived",
"(",
"null",
",",
"statusCode",
",",
"method",
",",
"sequence... | Asserts that the given message listener object received a response with the indicated status
code, CSeq method and CSeq sequence number.
@param statusCode The response status code to check for (eg, SipResponse.RINGING)
@param method The CSeq method to look for (SipRequest.INVITE, etc.)
@param sequenceNumber The CSeq s... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"received",
"a",
"response",
"with",
"the",
"indicated",
"status",
"code",
"CSeq",
"method",
"and",
"CSeq",
"sequence",
"number",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L259-L262 |
1,936 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertResponseReceived | public static void assertResponseReceived(String msg, int statusCode, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertTrue(msg, responseReceived(statusCode, obj));
} | java | public static void assertResponseReceived(String msg, int statusCode, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertTrue(msg, responseReceived(statusCode, obj));
} | [
"public",
"static",
"void",
"assertResponseReceived",
"(",
"String",
"msg",
",",
"int",
"statusCode",
",",
"MessageListener",
"obj",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"obj",
")",
";",
"assertTrue",
"(",
"msg",
",",
"responseR... | Asserts that the given message listener object received a response with the indicated status
code. Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param statusCode The response status code to check for (eg, SipResponse.RINGING)
@param obj The Message... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"received",
"a",
"response",
"with",
"the",
"indicated",
"status",
"code",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L272-L275 |
1,937 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.responseReceived | public static boolean responseReceived(int statusCode, MessageListener messageListener) {
ArrayList<SipResponse> responses = messageListener.getAllReceivedResponses();
for (SipResponse r : responses) {
if (statusCode == r.getStatusCode()) {
return true;
}
}
return false;
... | java | public static boolean responseReceived(int statusCode, MessageListener messageListener) {
ArrayList<SipResponse> responses = messageListener.getAllReceivedResponses();
for (SipResponse r : responses) {
if (statusCode == r.getStatusCode()) {
return true;
}
}
return false;
... | [
"public",
"static",
"boolean",
"responseReceived",
"(",
"int",
"statusCode",
",",
"MessageListener",
"messageListener",
")",
"{",
"ArrayList",
"<",
"SipResponse",
">",
"responses",
"=",
"messageListener",
".",
"getAllReceivedResponses",
"(",
")",
";",
"for",
"(",
... | Check the given message listener object received a response with the indicated status
code.
@param statusCode the code we want to find
@param messageListener the {@link MessageListener} we want to check
@return true if a received response matches the given statusCode | [
"Check",
"the",
"given",
"message",
"listener",
"object",
"received",
"a",
"response",
"with",
"the",
"indicated",
"status",
"code",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L303-L313 |
1,938 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertResponseNotReceived | public static void assertResponseNotReceived(int statusCode, String method, long sequenceNumber,
MessageListener obj) {
assertResponseNotReceived(null, statusCode, method, sequenceNumber, obj);
} | java | public static void assertResponseNotReceived(int statusCode, String method, long sequenceNumber,
MessageListener obj) {
assertResponseNotReceived(null, statusCode, method, sequenceNumber, obj);
} | [
"public",
"static",
"void",
"assertResponseNotReceived",
"(",
"int",
"statusCode",
",",
"String",
"method",
",",
"long",
"sequenceNumber",
",",
"MessageListener",
"obj",
")",
"{",
"assertResponseNotReceived",
"(",
"null",
",",
"statusCode",
",",
"method",
",",
"se... | Asserts that the given message listener object has not received a response with the indicated
status code, CSeq method and sequence number.
@param statusCode The response status code to verify absent (eg, SipResponse.RINGING)
@param method The CSeq method to verify absent (SipRequest.INVITE, etc.)
@param sequenceNumbe... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"has",
"not",
"received",
"a",
"response",
"with",
"the",
"indicated",
"status",
"code",
"CSeq",
"method",
"and",
"sequence",
"number",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L389-L392 |
1,939 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertResponseNotReceived | public static void assertResponseNotReceived(String msg, int statusCode, String method,
long sequenceNumber, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertFalse(msg, responseReceived(statusCode, method, sequenceNumber, obj));
} | java | public static void assertResponseNotReceived(String msg, int statusCode, String method,
long sequenceNumber, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertFalse(msg, responseReceived(statusCode, method, sequenceNumber, obj));
} | [
"public",
"static",
"void",
"assertResponseNotReceived",
"(",
"String",
"msg",
",",
"int",
"statusCode",
",",
"String",
"method",
",",
"long",
"sequenceNumber",
",",
"MessageListener",
"obj",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"... | Asserts that the given message listener object has not received a response with the indicated
status code, CSeq method and sequence number. Assertion failure output includes the given
message text.
@param msg message text to output if the assertion fails.
@param statusCode The response status code to verify absent (eg... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"has",
"not",
"received",
"a",
"response",
"with",
"the",
"indicated",
"status",
"code",
"CSeq",
"method",
"and",
"sequence",
"number",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L405-L409 |
1,940 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertRequestReceived | public static void assertRequestReceived(String method, long sequenceNumber, MessageListener obj) {
assertRequestReceived(null, method, sequenceNumber, obj);
} | java | public static void assertRequestReceived(String method, long sequenceNumber, MessageListener obj) {
assertRequestReceived(null, method, sequenceNumber, obj);
} | [
"public",
"static",
"void",
"assertRequestReceived",
"(",
"String",
"method",
",",
"long",
"sequenceNumber",
",",
"MessageListener",
"obj",
")",
"{",
"assertRequestReceived",
"(",
"null",
",",
"method",
",",
"sequenceNumber",
",",
"obj",
")",
";",
"}"
] | Asserts that the given message listener object received a request with the indicated CSeq
method and CSeq sequence number.
@param method The CSeq method to look for (SipRequest.REGISTER, etc.)
@param sequenceNumber The CSeq sequence number to look for
@param obj The MessageListener object (ie, SipCall, Subscription, e... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"received",
"a",
"request",
"with",
"the",
"indicated",
"CSeq",
"method",
"and",
"CSeq",
"sequence",
"number",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L430-L432 |
1,941 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertRequestReceived | public static void assertRequestReceived(String msg, String method, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertTrue(msg, requestReceived(method, obj));
} | java | public static void assertRequestReceived(String msg, String method, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertTrue(msg, requestReceived(method, obj));
} | [
"public",
"static",
"void",
"assertRequestReceived",
"(",
"String",
"msg",
",",
"String",
"method",
",",
"MessageListener",
"obj",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"obj",
")",
";",
"assertTrue",
"(",
"msg",
",",
"requestRece... | Asserts that the given message listener object received a request with the indicated request
method. Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param method The request method to check for (eg, SipRequest.INVITE)
@param obj The MessageListener o... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"received",
"a",
"request",
"with",
"the",
"indicated",
"request",
"method",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L442-L445 |
1,942 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertRequestNotReceived | public static void assertRequestNotReceived(String msg, String method, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertFalse(msg, requestReceived(method, obj));
} | java | public static void assertRequestNotReceived(String msg, String method, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertFalse(msg, requestReceived(method, obj));
} | [
"public",
"static",
"void",
"assertRequestNotReceived",
"(",
"String",
"msg",
",",
"String",
"method",
",",
"MessageListener",
"obj",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"obj",
")",
";",
"assertFalse",
"(",
"msg",
",",
"request... | Asserts that the given message listener object has not received a request with the indicated
request method. Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param method The request method to verify absent (eg, SipRequest.BYE)
@param obj The MessageL... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"has",
"not",
"received",
"a",
"request",
"with",
"the",
"indicated",
"request",
"method",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L519-L522 |
1,943 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertRequestNotReceived | public static void assertRequestNotReceived(String method, long sequenceNumber,
MessageListener obj) {
assertRequestNotReceived(null, method, sequenceNumber, obj);
} | java | public static void assertRequestNotReceived(String method, long sequenceNumber,
MessageListener obj) {
assertRequestNotReceived(null, method, sequenceNumber, obj);
} | [
"public",
"static",
"void",
"assertRequestNotReceived",
"(",
"String",
"method",
",",
"long",
"sequenceNumber",
",",
"MessageListener",
"obj",
")",
"{",
"assertRequestNotReceived",
"(",
"null",
",",
"method",
",",
"sequenceNumber",
",",
"obj",
")",
";",
"}"
] | Asserts that the given message listener object has not received a request with the indicated
CSeq method and sequence number.
@param method The CSeq method to verify absent (SipRequest.INVITE, etc.)
@param sequenceNumber The CSeq sequence number to verify absent
@param obj The MessageListener object (ie, SipCall, Subs... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"has",
"not",
"received",
"a",
"request",
"with",
"the",
"indicated",
"CSeq",
"method",
"and",
"sequence",
"number",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L533-L536 |
1,944 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertAnswered | public static void assertAnswered(String msg, SipCall call) {
assertNotNull("Null assert object passed in", call);
assertTrue(msg, call.isCallAnswered());
} | java | public static void assertAnswered(String msg, SipCall call) {
assertNotNull("Null assert object passed in", call);
assertTrue(msg, call.isCallAnswered());
} | [
"public",
"static",
"void",
"assertAnswered",
"(",
"String",
"msg",
",",
"SipCall",
"call",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"call",
")",
";",
"assertTrue",
"(",
"msg",
",",
"call",
".",
"isCallAnswered",
"(",
")",
")",
... | Asserts that the given incoming or outgoing call leg was answered. Assertion failure output
includes the given message text.
@param msg message text to output if the assertion fails.
@param call The incoming or outgoing call leg. | [
"Asserts",
"that",
"the",
"given",
"incoming",
"or",
"outgoing",
"call",
"leg",
"was",
"answered",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L569-L572 |
1,945 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.awaitAnswered | public static void awaitAnswered(final String msg, final SipCall call) {
await().until(new Runnable() {
@Override
public void run() {
assertAnswered(msg, call);
}
});
} | java | public static void awaitAnswered(final String msg, final SipCall call) {
await().until(new Runnable() {
@Override
public void run() {
assertAnswered(msg, call);
}
});
} | [
"public",
"static",
"void",
"awaitAnswered",
"(",
"final",
"String",
"msg",
",",
"final",
"SipCall",
"call",
")",
"{",
"await",
"(",
")",
".",
"until",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"a... | Awaits that the given incoming or outgoing call leg was answered. Assertion failure output
includes the given message text.
@param msg message text to output if the assertion fails.
@param call The incoming or outgoing call leg. | [
"Awaits",
"that",
"the",
"given",
"incoming",
"or",
"outgoing",
"call",
"leg",
"was",
"answered",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L591-L599 |
1,946 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertNotAnswered | public static void assertNotAnswered(String msg, SipCall call) {
assertNotNull("Null assert object passed in", call);
assertFalse(msg, call.isCallAnswered());
} | java | public static void assertNotAnswered(String msg, SipCall call) {
assertNotNull("Null assert object passed in", call);
assertFalse(msg, call.isCallAnswered());
} | [
"public",
"static",
"void",
"assertNotAnswered",
"(",
"String",
"msg",
",",
"SipCall",
"call",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"call",
")",
";",
"assertFalse",
"(",
"msg",
",",
"call",
".",
"isCallAnswered",
"(",
")",
"... | Asserts that the given incoming or outgoing call leg has not been answered. Assertion failure
output includes the given message text.
@param msg message text to output if the assertion fails.
@param call The incoming or outgoing call leg. | [
"Asserts",
"that",
"the",
"given",
"incoming",
"or",
"outgoing",
"call",
"leg",
"has",
"not",
"been",
"answered",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L627-L630 |
1,947 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertBodyPresent | public static void assertBodyPresent(String msg, SipMessage sipMessage) {
assertNotNull("Null assert object passed in", sipMessage);
assertTrue(msg, sipMessage.getContentLength() > 0);
} | java | public static void assertBodyPresent(String msg, SipMessage sipMessage) {
assertNotNull("Null assert object passed in", sipMessage);
assertTrue(msg, sipMessage.getContentLength() > 0);
} | [
"public",
"static",
"void",
"assertBodyPresent",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"assertTrue",
"(",
"msg",
",",
"sipMessage",
".",
"getContentLeng... | Asserts that the given SIP message contains a body. Assertion failure output includes the given
message text.
@param msg message text to output if the assertion fails.
@param sipMessage the SIP message. | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"a",
"body",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L648-L651 |
1,948 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertBodyNotPresent | public static void assertBodyNotPresent(String msg, SipMessage sipMessage) {
assertNotNull("Null assert object passed in", sipMessage);
assertFalse(msg, sipMessage.getContentLength() > 0);
} | java | public static void assertBodyNotPresent(String msg, SipMessage sipMessage) {
assertNotNull("Null assert object passed in", sipMessage);
assertFalse(msg, sipMessage.getContentLength() > 0);
} | [
"public",
"static",
"void",
"assertBodyNotPresent",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"assertFalse",
"(",
"msg",
",",
"sipMessage",
".",
"getContent... | Asserts that the given SIP message contains no body. Assertion failure output includes the
given message text.
@param msg message text to output if the assertion fails.
@param sipMessage the SIP message. | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"no",
"body",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L669-L672 |
1,949 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertBodyContains | public static void assertBodyContains(String msg, SipMessage sipMessage, String value) {
assertNotNull("Null assert object passed in", sipMessage);
assertBodyPresent(msg, sipMessage);
String body = new String(sipMessage.getRawContent());
if (body.indexOf(value) != -1) {
assertTrue(true);
... | java | public static void assertBodyContains(String msg, SipMessage sipMessage, String value) {
assertNotNull("Null assert object passed in", sipMessage);
assertBodyPresent(msg, sipMessage);
String body = new String(sipMessage.getRawContent());
if (body.indexOf(value) != -1) {
assertTrue(true);
... | [
"public",
"static",
"void",
"assertBodyContains",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
",",
"String",
"value",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"assertBodyPresent",
"(",
"msg",
",",
... | Asserts that the given SIP message contains a body that includes the given value. The assertion
fails if a body is not present in the message or is present but doesn't include the value.
Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param sipMessag... | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"a",
"body",
"that",
"includes",
"the",
"given",
"value",
".",
"The",
"assertion",
"fails",
"if",
"a",
"body",
"is",
"not",
"present",
"in",
"the",
"message",
"or",
"is",
"present",
"but",
... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L698-L709 |
1,950 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertBodyNotContains | public static void assertBodyNotContains(String msg, SipMessage sipMessage, String value) {
assertNotNull("Null assert object passed in", sipMessage);
if (sipMessage.getContentLength() > 0) {
String body = new String(sipMessage.getRawContent());
if (body.indexOf(value) != -1) {
fail(m... | java | public static void assertBodyNotContains(String msg, SipMessage sipMessage, String value) {
assertNotNull("Null assert object passed in", sipMessage);
if (sipMessage.getContentLength() > 0) {
String body = new String(sipMessage.getRawContent());
if (body.indexOf(value) != -1) {
fail(m... | [
"public",
"static",
"void",
"assertBodyNotContains",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
",",
"String",
"value",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"if",
"(",
"sipMessage",
".",
"getC... | Asserts that the body in the given SIP message does not contain the value given, or that there
is no body in the message. The assertion fails if the body is present and contains the value.
Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param sipMess... | [
"Asserts",
"that",
"the",
"body",
"in",
"the",
"given",
"SIP",
"message",
"does",
"not",
"contain",
"the",
"value",
"given",
"or",
"that",
"there",
"is",
"no",
"body",
"in",
"the",
"message",
".",
"The",
"assertion",
"fails",
"if",
"the",
"body",
"is",
... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L735-L746 |
1,951 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipStack.java | SipStack.dumpMessage | public static void dumpMessage(String informationalHeader, javax.sip.message.Message msg) {
LOG.trace(informationalHeader + "{}.......... \n {}", informationalHeader, msg);
ListIterator rhdrs = msg.getHeaders(RouteHeader.NAME);
while (rhdrs.hasNext()) {
RouteHeader rhdr = (RouteHeader) rhdrs.next();
... | java | public static void dumpMessage(String informationalHeader, javax.sip.message.Message msg) {
LOG.trace(informationalHeader + "{}.......... \n {}", informationalHeader, msg);
ListIterator rhdrs = msg.getHeaders(RouteHeader.NAME);
while (rhdrs.hasNext()) {
RouteHeader rhdr = (RouteHeader) rhdrs.next();
... | [
"public",
"static",
"void",
"dumpMessage",
"(",
"String",
"informationalHeader",
",",
"javax",
".",
"sip",
".",
"message",
".",
"Message",
"msg",
")",
"{",
"LOG",
".",
"trace",
"(",
"informationalHeader",
"+",
"\"{}.......... \\n {}\"",
",",
"informationalHeader",... | Outputs to console the provided header string followed by the message.
@param informationalHeader
@param msg | [
"Outputs",
"to",
"console",
"the",
"provided",
"header",
"string",
"followed",
"by",
"the",
"message",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipStack.java#L452-L482 |
1,952 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/EventSubscriber.java | EventSubscriber.createNotifyResponse | protected Response createNotifyResponse(RequestEvent request, int status, String reason,
List<Header> additionalHeaders) {
// when used internally - WATCH OUT - retcode, errorMessage initialized here
initErrorInfo();
if ((request == null) || (request.getRequest() == null)) {
setReturnCode(SipSe... | java | protected Response createNotifyResponse(RequestEvent request, int status, String reason,
List<Header> additionalHeaders) {
// when used internally - WATCH OUT - retcode, errorMessage initialized here
initErrorInfo();
if ((request == null) || (request.getRequest() == null)) {
setReturnCode(SipSe... | [
"protected",
"Response",
"createNotifyResponse",
"(",
"RequestEvent",
"request",
",",
"int",
"status",
",",
"String",
"reason",
",",
"List",
"<",
"Header",
">",
"additionalHeaders",
")",
"{",
"// when used internally - WATCH OUT - retcode, errorMessage initialized here",
"i... | if returns null, returnCode and errorMessage already set | [
"if",
"returns",
"null",
"returnCode",
"and",
"errorMessage",
"already",
"set"
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/EventSubscriber.java#L1398-L1440 |
1,953 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipPhone.java | SipPhone.unregister | public boolean unregister(String contact, long timeout) {
initErrorInfo();
// TODO - need to support multiple server(s)/registrations
// simultaneously?
// then return registration() object to user (w/lastregrequest) and
// receive
// it here, get rid of lastRegistrationRequest
if (lastReg... | java | public boolean unregister(String contact, long timeout) {
initErrorInfo();
// TODO - need to support multiple server(s)/registrations
// simultaneously?
// then return registration() object to user (w/lastregrequest) and
// receive
// it here, get rid of lastRegistrationRequest
if (lastReg... | [
"public",
"boolean",
"unregister",
"(",
"String",
"contact",
",",
"long",
"timeout",
")",
"{",
"initErrorInfo",
"(",
")",
";",
"// TODO - need to support multiple server(s)/registrations",
"// simultaneously?",
"// then return registration() object to user (w/lastregrequest) and",
... | This method performs the SIP unregistration process. It returns true if unregistration was
successful or no unregistration was needed, and false otherwise. Any authorization headers
required for the last registration are cleared out. If there was no previous registration, this
method does not send any messages.
<p>
If... | [
"This",
"method",
"performs",
"the",
"SIP",
"unregistration",
"process",
".",
"It",
"returns",
"true",
"if",
"unregistration",
"was",
"successful",
"or",
"no",
"unregistration",
"was",
"needed",
"and",
"false",
"otherwise",
".",
"Any",
"authorization",
"headers",
... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipPhone.java#L384-L443 |
1,954 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipPhone.java | SipPhone.createSipCall | public SipCall createSipCall() {
initErrorInfo();
SipCall call = new SipCall(this, myAddress);
callList.add(call);
return call;
} | java | public SipCall createSipCall() {
initErrorInfo();
SipCall call = new SipCall(this, myAddress);
callList.add(call);
return call;
} | [
"public",
"SipCall",
"createSipCall",
"(",
")",
"{",
"initErrorInfo",
"(",
")",
";",
"SipCall",
"call",
"=",
"new",
"SipCall",
"(",
"this",
",",
"myAddress",
")",
";",
"callList",
".",
"add",
"(",
"call",
")",
";",
"return",
"call",
";",
"}"
] | This method is used to create a SipCall object for handling one leg of a call. That is, it
represents an outgoing call leg or an incoming call leg. In a telephone call, there are two
call legs. The outgoing call leg is the connection from the phone making the call to the
telephone network. The incoming call leg is a co... | [
"This",
"method",
"is",
"used",
"to",
"create",
"a",
"SipCall",
"object",
"for",
"handling",
"one",
"leg",
"of",
"a",
"call",
".",
"That",
"is",
"it",
"represents",
"an",
"outgoing",
"call",
"leg",
"or",
"an",
"incoming",
"call",
"leg",
".",
"In",
"a",... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipPhone.java#L725-L733 |
1,955 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipPhone.java | SipPhone.makeCall | public SipCall makeCall(String to, int response, long timeout, String viaNonProxyRoute) {
return makeCall(to, response, timeout, viaNonProxyRoute, null, null, null);
} | java | public SipCall makeCall(String to, int response, long timeout, String viaNonProxyRoute) {
return makeCall(to, response, timeout, viaNonProxyRoute, null, null, null);
} | [
"public",
"SipCall",
"makeCall",
"(",
"String",
"to",
",",
"int",
"response",
",",
"long",
"timeout",
",",
"String",
"viaNonProxyRoute",
")",
"{",
"return",
"makeCall",
"(",
"to",
",",
"response",
",",
"timeout",
",",
"viaNonProxyRoute",
",",
"null",
",",
... | This blocking basic method is used to make an outgoing call. It blocks until the specified
INVITE response status code is received. The object returned is a SipCall object representing
the outgoing call leg; that is, the UAC originating a call to the network. Then you can take
subsequent action on the call by making me... | [
"This",
"blocking",
"basic",
"method",
"is",
"used",
"to",
"make",
"an",
"outgoing",
"call",
".",
"It",
"blocks",
"until",
"the",
"specified",
"INVITE",
"response",
"status",
"code",
"is",
"received",
".",
"The",
"object",
"returned",
"is",
"a",
"SipCall",
... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipPhone.java#L778-L780 |
1,956 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/MessageDigestAlgorithm.java | MessageDigestAlgorithm.calculateResponse | public static String calculateResponse(String algorithm, String username_value,
String realm_value, String passwd, String nonce_value, String nc_value, String cnonce_value,
String Method, String digest_uri_value, String entity_body, String qop_value) {
if (username_value == null || realm_value == null |... | java | public static String calculateResponse(String algorithm, String username_value,
String realm_value, String passwd, String nonce_value, String nc_value, String cnonce_value,
String Method, String digest_uri_value, String entity_body, String qop_value) {
if (username_value == null || realm_value == null |... | [
"public",
"static",
"String",
"calculateResponse",
"(",
"String",
"algorithm",
",",
"String",
"username_value",
",",
"String",
"realm_value",
",",
"String",
"passwd",
",",
"String",
"nonce_value",
",",
"String",
"nc_value",
",",
"String",
"cnonce_value",
",",
"Str... | Calculates a response an http authentication response in accordance with rfc2617.
<p>
This method was copied from the Sip Communicator project (package
net.java.sip.communicator.sip.security, its author is Emil Ivov) and slightly modified here (to
remove console/log messages). Thanks for making it publicly available. ... | [
"Calculates",
"a",
"response",
"an",
"http",
"authentication",
"response",
"in",
"accordance",
"with",
"rfc2617",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/MessageDigestAlgorithm.java#L66-L111 |
1,957 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipRequest.java | SipRequest.getRequestURI | public String getRequestURI() {
if ((message == null) || (((Request) message).getRequestURI() == null)) {
return "";
}
return ((Request) message).getRequestURI().toString();
} | java | public String getRequestURI() {
if ((message == null) || (((Request) message).getRequestURI() == null)) {
return "";
}
return ((Request) message).getRequestURI().toString();
} | [
"public",
"String",
"getRequestURI",
"(",
")",
"{",
"if",
"(",
"(",
"message",
"==",
"null",
")",
"||",
"(",
"(",
"(",
"Request",
")",
"message",
")",
".",
"getRequestURI",
"(",
")",
"==",
"null",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"return"... | Returns the request URI line of the request message or an empty string if there isn't one. The
request URI indicates the user or service to which this request is addressed.
@return the Request URI line as a string or "" if there isn't one | [
"Returns",
"the",
"request",
"URI",
"line",
"of",
"the",
"request",
"message",
"or",
"an",
"empty",
"string",
"if",
"there",
"isn",
"t",
"one",
".",
"The",
"request",
"URI",
"indicates",
"the",
"user",
"or",
"service",
"to",
"which",
"this",
"request",
"... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipRequest.java#L106-L112 |
1,958 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipRequest.java | SipRequest.isSipURI | public boolean isSipURI() {
if ((message == null) || (((Request) message).getRequestURI() == null)) {
return false;
}
return ((Request) message).getRequestURI().isSipURI();
} | java | public boolean isSipURI() {
if ((message == null) || (((Request) message).getRequestURI() == null)) {
return false;
}
return ((Request) message).getRequestURI().isSipURI();
} | [
"public",
"boolean",
"isSipURI",
"(",
")",
"{",
"if",
"(",
"(",
"message",
"==",
"null",
")",
"||",
"(",
"(",
"(",
"Request",
")",
"message",
")",
".",
"getRequestURI",
"(",
")",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
... | Indicates if the request URI in the request message is a URI with a scheme of "sip" or "sips".
@return true if the request URI scheme is "sip" or "sips", false otherwise. | [
"Indicates",
"if",
"the",
"request",
"URI",
"in",
"the",
"request",
"message",
"is",
"a",
"URI",
"with",
"a",
"scheme",
"of",
"sip",
"or",
"sips",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipRequest.java#L119-L125 |
1,959 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipRequest.java | SipRequest.isInvite | public boolean isInvite() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.INVITE));
} | java | public boolean isInvite() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.INVITE));
} | [
"public",
"boolean",
"isInvite",
"(",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"(",
"(",
"Request",
")",
"message",
")",
".",
"getMethod",
"(",
")",
".",
"equals",
"(",
"Request",
".",
"INV... | Indicates if the request method is INVITE or not.
@return true if the method is INVITE, false otherwise. | [
"Indicates",
"if",
"the",
"request",
"method",
"is",
"INVITE",
"or",
"not",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipRequest.java#L132-L138 |
1,960 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipRequest.java | SipRequest.isAck | public boolean isAck() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.ACK));
} | java | public boolean isAck() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.ACK));
} | [
"public",
"boolean",
"isAck",
"(",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"(",
"(",
"Request",
")",
"message",
")",
".",
"getMethod",
"(",
")",
".",
"equals",
"(",
"Request",
".",
"ACK",
... | Indicates if the request method is ACK or not.
@return true if the method is ACK, false otherwise. | [
"Indicates",
"if",
"the",
"request",
"method",
"is",
"ACK",
"or",
"not",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipRequest.java#L145-L151 |
1,961 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipRequest.java | SipRequest.isBye | public boolean isBye() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.BYE));
} | java | public boolean isBye() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.BYE));
} | [
"public",
"boolean",
"isBye",
"(",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"(",
"(",
"Request",
")",
"message",
")",
".",
"getMethod",
"(",
")",
".",
"equals",
"(",
"Request",
".",
"BYE",
... | Indicates if the request method is BYE or not.
@return true if the method is BYE, false otherwise. | [
"Indicates",
"if",
"the",
"request",
"method",
"is",
"BYE",
"or",
"not",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipRequest.java#L158-L164 |
1,962 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipRequest.java | SipRequest.isNotify | public boolean isNotify() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.NOTIFY));
} | java | public boolean isNotify() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.NOTIFY));
} | [
"public",
"boolean",
"isNotify",
"(",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"(",
"(",
"Request",
")",
"message",
")",
".",
"getMethod",
"(",
")",
".",
"equals",
"(",
"Request",
".",
"NOT... | Indicates if the request method is NOTIFY or not.
@return true if the method is NOTIFY, false otherwise. | [
"Indicates",
"if",
"the",
"request",
"method",
"is",
"NOTIFY",
"or",
"not",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipRequest.java#L171-L177 |
1,963 | RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipRequest.java | SipRequest.isSubscribe | public boolean isSubscribe() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.SUBSCRIBE));
} | java | public boolean isSubscribe() {
if (message == null) {
return false;
}
return (((Request) message).getMethod().equals(Request.SUBSCRIBE));
} | [
"public",
"boolean",
"isSubscribe",
"(",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"(",
"(",
"Request",
")",
"message",
")",
".",
"getMethod",
"(",
")",
".",
"equals",
"(",
"Request",
".",
"... | Indicates if the request method is SUBSCRIBE or not.
@return true if the method is SUBSCRIBE, false otherwise. | [
"Indicates",
"if",
"the",
"request",
"method",
"is",
"SUBSCRIBE",
"or",
"not",
"."
] | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipRequest.java#L184-L190 |
1,964 | wmz7year/Thrift-Connection-Pool | src/main/java/com/wmz7year/thrift/pool/TaskEngine.java | TaskEngine.schedule | public void schedule(TimerTask task, Date time) {
timer.schedule(new TimerTaskWrapper(task), time);
} | java | public void schedule(TimerTask task, Date time) {
timer.schedule(new TimerTaskWrapper(task), time);
} | [
"public",
"void",
"schedule",
"(",
"TimerTask",
"task",
",",
"Date",
"time",
")",
"{",
"timer",
".",
"schedule",
"(",
"new",
"TimerTaskWrapper",
"(",
"task",
")",
",",
"time",
")",
";",
"}"
] | Schedules the specified task for execution at the specified time. If the
time is in the past, the task is scheduled for immediate execution.
@param task
task to be scheduled.
@param time
time at which task is to be executed.
@throws IllegalArgumentException
if <tt>time.getTime()</tt> is negative.
@throws IllegalStateE... | [
"Schedules",
"the",
"specified",
"task",
"for",
"execution",
"at",
"the",
"specified",
"time",
".",
"If",
"the",
"time",
"is",
"in",
"the",
"past",
"the",
"task",
"is",
"scheduled",
"for",
"immediate",
"execution",
"."
] | 664df53dab12f87a53442e63dcaef1a7af5a484b | https://github.com/wmz7year/Thrift-Connection-Pool/blob/664df53dab12f87a53442e63dcaef1a7af5a484b/src/main/java/com/wmz7year/thrift/pool/TaskEngine.java#L122-L124 |
1,965 | wmz7year/Thrift-Connection-Pool | src/main/java/com/wmz7year/thrift/pool/TaskEngine.java | TaskEngine.shutdown | public void shutdown() {
if (executor != null) {
executor.shutdown();
executor = null;
}
if (timer != null) {
timer.cancel();
timer = null;
}
instance = null;
} | java | public void shutdown() {
if (executor != null) {
executor.shutdown();
executor = null;
}
if (timer != null) {
timer.cancel();
timer = null;
}
instance = null;
} | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"executor",
"!=",
"null",
")",
"{",
"executor",
".",
"shutdown",
"(",
")",
";",
"executor",
"=",
"null",
";",
"}",
"if",
"(",
"timer",
"!=",
"null",
")",
"{",
"timer",
".",
"cancel",
"(",
")... | Shuts down the task engine service. | [
"Shuts",
"down",
"the",
"task",
"engine",
"service",
"."
] | 664df53dab12f87a53442e63dcaef1a7af5a484b | https://github.com/wmz7year/Thrift-Connection-Pool/blob/664df53dab12f87a53442e63dcaef1a7af5a484b/src/main/java/com/wmz7year/thrift/pool/TaskEngine.java#L311-L323 |
1,966 | alexxiyang/jdbctemplatetool | src/main/java/org/crazycake/jdbcTemplateTool/utils/ModelSqlUtils.java | ModelSqlUtils.getColumnNameFromGetter | private static String getColumnNameFromGetter(Method getter,Field f){
String columnName = "";
Column columnAnno = getter.getAnnotation(Column.class);
if(columnAnno != null){
//如果是列注解就读取name属性
columnName = columnAnno.name();
}
if(columnName == null || "".equals(columnName)){
//如果没有列注解就用命名方式去猜
co... | java | private static String getColumnNameFromGetter(Method getter,Field f){
String columnName = "";
Column columnAnno = getter.getAnnotation(Column.class);
if(columnAnno != null){
//如果是列注解就读取name属性
columnName = columnAnno.name();
}
if(columnName == null || "".equals(columnName)){
//如果没有列注解就用命名方式去猜
co... | [
"private",
"static",
"String",
"getColumnNameFromGetter",
"(",
"Method",
"getter",
",",
"Field",
"f",
")",
"{",
"String",
"columnName",
"=",
"\"\"",
";",
"Column",
"columnAnno",
"=",
"getter",
".",
"getAnnotation",
"(",
"Column",
".",
"class",
")",
";",
"if"... | use getter to guess column name, if there is annotation then use annotation value, if not then guess from field name
@param getter
@param f
@return
@throws NoColumnAnnotationFoundException | [
"use",
"getter",
"to",
"guess",
"column",
"name",
"if",
"there",
"is",
"annotation",
"then",
"use",
"annotation",
"value",
"if",
"not",
"then",
"guess",
"from",
"field",
"name"
] | 8406e0a7eb13677c4b7147a12f5f95caf9498aeb | https://github.com/alexxiyang/jdbctemplatetool/blob/8406e0a7eb13677c4b7147a12f5f95caf9498aeb/src/main/java/org/crazycake/jdbcTemplateTool/utils/ModelSqlUtils.java#L362-L375 |
1,967 | alexxiyang/jdbctemplatetool | src/main/java/org/crazycake/jdbcTemplateTool/utils/InUtils.java | InUtils.handleIn | public static SqlParamsPairs handleIn(String sql, Object[] params){
//split with question mark placeholder
String[] sqlPieces = sql.split("\\?");
//question mark placeholder list
String[] questionPlaceholders;
if(sql.endsWith("?")){
questionPlaceholders = new String[sqlPieces.length];
}else{
que... | java | public static SqlParamsPairs handleIn(String sql, Object[] params){
//split with question mark placeholder
String[] sqlPieces = sql.split("\\?");
//question mark placeholder list
String[] questionPlaceholders;
if(sql.endsWith("?")){
questionPlaceholders = new String[sqlPieces.length];
}else{
que... | [
"public",
"static",
"SqlParamsPairs",
"handleIn",
"(",
"String",
"sql",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"//split with question mark placeholder",
"String",
"[",
"]",
"sqlPieces",
"=",
"sql",
".",
"split",
"(",
"\"\\\\?\"",
")",
";",
"//question mark... | Change sql if found array in params
@param sql
@param params
@return | [
"Change",
"sql",
"if",
"found",
"array",
"in",
"params"
] | 8406e0a7eb13677c4b7147a12f5f95caf9498aeb | https://github.com/alexxiyang/jdbctemplatetool/blob/8406e0a7eb13677c4b7147a12f5f95caf9498aeb/src/main/java/org/crazycake/jdbcTemplateTool/utils/InUtils.java#L21-L77 |
1,968 | alexxiyang/jdbctemplatetool | src/main/java/org/crazycake/jdbcTemplateTool/utils/IdUtils.java | IdUtils.toCamel | public static String toCamel(String name) {
return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name);
} | java | public static String toCamel(String name) {
return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name);
} | [
"public",
"static",
"String",
"toCamel",
"(",
"String",
"name",
")",
"{",
"return",
"CaseFormat",
".",
"LOWER_UNDERSCORE",
".",
"to",
"(",
"CaseFormat",
".",
"LOWER_CAMEL",
",",
"name",
")",
";",
"}"
] | Convert underscore style to camel style
@param name
@return | [
"Convert",
"underscore",
"style",
"to",
"camel",
"style"
] | 8406e0a7eb13677c4b7147a12f5f95caf9498aeb | https://github.com/alexxiyang/jdbctemplatetool/blob/8406e0a7eb13677c4b7147a12f5f95caf9498aeb/src/main/java/org/crazycake/jdbcTemplateTool/utils/IdUtils.java#L74-L76 |
1,969 | alexxiyang/jdbctemplatetool | src/main/java/org/crazycake/jdbcTemplateTool/utils/IdUtils.java | IdUtils.toUnderscore | public static String toUnderscore(String name) {
return CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
} | java | public static String toUnderscore(String name) {
return CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
} | [
"public",
"static",
"String",
"toUnderscore",
"(",
"String",
"name",
")",
"{",
"return",
"CaseFormat",
".",
"LOWER_CAMEL",
".",
"to",
"(",
"CaseFormat",
".",
"LOWER_UNDERSCORE",
",",
"name",
")",
";",
"}"
] | Convert camel style to underscore style
@param name
@return | [
"Convert",
"camel",
"style",
"to",
"underscore",
"style"
] | 8406e0a7eb13677c4b7147a12f5f95caf9498aeb | https://github.com/alexxiyang/jdbctemplatetool/blob/8406e0a7eb13677c4b7147a12f5f95caf9498aeb/src/main/java/org/crazycake/jdbcTemplateTool/utils/IdUtils.java#L83-L85 |
1,970 | alexxiyang/jdbctemplatetool | src/main/java/org/crazycake/jdbcTemplateTool/JdbcTemplateTool.java | JdbcTemplateTool.getProxy | private JdbcTemplateProxy getProxy(){
if(_proxy == null){
_proxy = new JdbcTemplateProxy();
_proxy.setJdbcTemplate(jdbcTemplate);
}
return _proxy;
} | java | private JdbcTemplateProxy getProxy(){
if(_proxy == null){
_proxy = new JdbcTemplateProxy();
_proxy.setJdbcTemplate(jdbcTemplate);
}
return _proxy;
} | [
"private",
"JdbcTemplateProxy",
"getProxy",
"(",
")",
"{",
"if",
"(",
"_proxy",
"==",
"null",
")",
"{",
"_proxy",
"=",
"new",
"JdbcTemplateProxy",
"(",
")",
";",
"_proxy",
".",
"setJdbcTemplate",
"(",
"jdbcTemplate",
")",
";",
"}",
"return",
"_proxy",
";",... | return the singleton proxy | [
"return",
"the",
"singleton",
"proxy"
] | 8406e0a7eb13677c4b7147a12f5f95caf9498aeb | https://github.com/alexxiyang/jdbctemplatetool/blob/8406e0a7eb13677c4b7147a12f5f95caf9498aeb/src/main/java/org/crazycake/jdbcTemplateTool/JdbcTemplateTool.java#L39-L45 |
1,971 | alexxiyang/jdbctemplatetool | src/main/java/org/crazycake/jdbcTemplateTool/JdbcTemplateProxy.java | JdbcTemplateProxy.insert | public int insert(String sql,Object[] params,String autoGeneratedColumnName)
throws DataAccessException{
//dynamic change catalog name
sql = changeCatalog(sql);
ReturnIdPreparedStatementCreator psc = new ReturnIdPreparedStatementCreator(sql, params, autoGeneratedColumnName);
KeyHolder keyHolder = new Gene... | java | public int insert(String sql,Object[] params,String autoGeneratedColumnName)
throws DataAccessException{
//dynamic change catalog name
sql = changeCatalog(sql);
ReturnIdPreparedStatementCreator psc = new ReturnIdPreparedStatementCreator(sql, params, autoGeneratedColumnName);
KeyHolder keyHolder = new Gene... | [
"public",
"int",
"insert",
"(",
"String",
"sql",
",",
"Object",
"[",
"]",
"params",
",",
"String",
"autoGeneratedColumnName",
")",
"throws",
"DataAccessException",
"{",
"//dynamic change catalog name",
"sql",
"=",
"changeCatalog",
"(",
"sql",
")",
";",
"ReturnIdPr... | insert a row with auto increament id
@param sql
@param params
@param autoGeneratedColumnName
@return
@throws DataAccessException | [
"insert",
"a",
"row",
"with",
"auto",
"increament",
"id"
] | 8406e0a7eb13677c4b7147a12f5f95caf9498aeb | https://github.com/alexxiyang/jdbctemplatetool/blob/8406e0a7eb13677c4b7147a12f5f95caf9498aeb/src/main/java/org/crazycake/jdbcTemplateTool/JdbcTemplateProxy.java#L119-L140 |
1,972 | alexxiyang/jdbctemplatetool | src/main/java/org/crazycake/jdbcTemplateTool/utils/CatalogUtils.java | CatalogUtils.changeCatalog | public static String changeCatalog(String sql){
CatalogContext catalogContext = catalogContextHolder.get();
if(catalogContext != null && catalogContext.getCatalog() != null && catalogContext.getPlaceHolder() != null){
sql = sql.replace(catalogContext.getPlaceHolder(), catalogContext.getCatalog());
}
logger.d... | java | public static String changeCatalog(String sql){
CatalogContext catalogContext = catalogContextHolder.get();
if(catalogContext != null && catalogContext.getCatalog() != null && catalogContext.getPlaceHolder() != null){
sql = sql.replace(catalogContext.getPlaceHolder(), catalogContext.getCatalog());
}
logger.d... | [
"public",
"static",
"String",
"changeCatalog",
"(",
"String",
"sql",
")",
"{",
"CatalogContext",
"catalogContext",
"=",
"catalogContextHolder",
".",
"get",
"(",
")",
";",
"if",
"(",
"catalogContext",
"!=",
"null",
"&&",
"catalogContext",
".",
"getCatalog",
"(",
... | JdbcTemplateTool supports mulitiple catalog query. You can put a placeholder before your table name, JdbcTemplateTool will change this placeholder to real catalog name with the catalog stored in catalogContext.
@param sql
@return | [
"JdbcTemplateTool",
"supports",
"mulitiple",
"catalog",
"query",
".",
"You",
"can",
"put",
"a",
"placeholder",
"before",
"your",
"table",
"name",
"JdbcTemplateTool",
"will",
"change",
"this",
"placeholder",
"to",
"real",
"catalog",
"name",
"with",
"the",
"catalog"... | 8406e0a7eb13677c4b7147a12f5f95caf9498aeb | https://github.com/alexxiyang/jdbctemplatetool/blob/8406e0a7eb13677c4b7147a12f5f95caf9498aeb/src/main/java/org/crazycake/jdbcTemplateTool/utils/CatalogUtils.java#L29-L36 |
1,973 | qos-ch/cal10n | cal10n-api/src/main/java/ch/qos/cal10n/util/Parser.java | Parser.V | private void V(StringBuilder buf) {
Token t = getNextToken();
if (t.tokenType != TokenType.VALUE) {
throw new IllegalStateException("Unexpected token " + t);
}
buf.append(t.getValue());
t = getNextToken();
if (t.tokenType == TokenType.EOL) {
return;
} else if (t.tokenType == To... | java | private void V(StringBuilder buf) {
Token t = getNextToken();
if (t.tokenType != TokenType.VALUE) {
throw new IllegalStateException("Unexpected token " + t);
}
buf.append(t.getValue());
t = getNextToken();
if (t.tokenType == TokenType.EOL) {
return;
} else if (t.tokenType == To... | [
"private",
"void",
"V",
"(",
"StringBuilder",
"buf",
")",
"{",
"Token",
"t",
"=",
"getNextToken",
"(",
")",
";",
"if",
"(",
"t",
".",
"tokenType",
"!=",
"TokenType",
".",
"VALUE",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Unexpected token ... | Vopt = EOL V | [
"Vopt",
"=",
"EOL",
"V"
] | 22c048801fb6d04c991a0c8c01bb6fb97ef50b37 | https://github.com/qos-ch/cal10n/blob/22c048801fb6d04c991a0c8c01bb6fb97ef50b37/cal10n-api/src/main/java/ch/qos/cal10n/util/Parser.java#L88-L103 |
1,974 | qos-ch/cal10n | cal10n-api/src/main/java/ch/qos/cal10n/verifier/AbstractMessageKeyVerifier.java | AbstractMessageKeyVerifier.verifyAllLocales | public List<Cal10nError> verifyAllLocales() {
List<Cal10nError> errorList = new ArrayList<Cal10nError>();
String[] localeNameArray = getLocaleNames();
ErrorFactory errorFactory = new ErrorFactory(enumTypeAsStr, null, getBaseName());
if (localeNameArray == null || localeNameArray.length == 0) {
... | java | public List<Cal10nError> verifyAllLocales() {
List<Cal10nError> errorList = new ArrayList<Cal10nError>();
String[] localeNameArray = getLocaleNames();
ErrorFactory errorFactory = new ErrorFactory(enumTypeAsStr, null, getBaseName());
if (localeNameArray == null || localeNameArray.length == 0) {
... | [
"public",
"List",
"<",
"Cal10nError",
">",
"verifyAllLocales",
"(",
")",
"{",
"List",
"<",
"Cal10nError",
">",
"errorList",
"=",
"new",
"ArrayList",
"<",
"Cal10nError",
">",
"(",
")",
";",
"String",
"[",
"]",
"localeNameArray",
"=",
"getLocaleNames",
"(",
... | Verify all declared locales in one step. | [
"Verify",
"all",
"declared",
"locales",
"in",
"one",
"step",
"."
] | 22c048801fb6d04c991a0c8c01bb6fb97ef50b37 | https://github.com/qos-ch/cal10n/blob/22c048801fb6d04c991a0c8c01bb6fb97ef50b37/cal10n-api/src/main/java/ch/qos/cal10n/verifier/AbstractMessageKeyVerifier.java#L130-L149 |
1,975 | smurn/jPLY | jply/src/main/java/org/smurn/jply/BinaryElementReader.java | BinaryElementReader.readListProperty | private double[] readListProperty(final ListProperty property)
throws IOException {
int valueCount = (int) stream.read(property.getCountType());
double[] values = new double[valueCount];
for (int i = 0; i < values.length; i++) {
values[i] = stream.read(property.getType())... | java | private double[] readListProperty(final ListProperty property)
throws IOException {
int valueCount = (int) stream.read(property.getCountType());
double[] values = new double[valueCount];
for (int i = 0; i < values.length; i++) {
values[i] = stream.read(property.getType())... | [
"private",
"double",
"[",
"]",
"readListProperty",
"(",
"final",
"ListProperty",
"property",
")",
"throws",
"IOException",
"{",
"int",
"valueCount",
"=",
"(",
"int",
")",
"stream",
".",
"read",
"(",
"property",
".",
"getCountType",
"(",
")",
")",
";",
"dou... | Reads the values of a list-property.
@param property Property to read.
@return Values of that property.
@throws IOException if reading fails. | [
"Reads",
"the",
"values",
"of",
"a",
"list",
"-",
"property",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/BinaryElementReader.java#L105-L113 |
1,976 | smurn/jPLY | jply/src/main/java/org/smurn/jply/ElementType.java | ElementType.parse | static HeaderEntry parse(final String elementLine) throws IOException {
if (!elementLine.startsWith("element ")) {
throw new IOException("not an element: '"
+ elementLine + "'");
}
String definition = elementLine.substring("element ".length());
String[] p... | java | static HeaderEntry parse(final String elementLine) throws IOException {
if (!elementLine.startsWith("element ")) {
throw new IOException("not an element: '"
+ elementLine + "'");
}
String definition = elementLine.substring("element ".length());
String[] p... | [
"static",
"HeaderEntry",
"parse",
"(",
"final",
"String",
"elementLine",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"elementLine",
".",
"startsWith",
"(",
"\"element \"",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"not an element: '\"",
"+",
... | Parses a header line starting an element description.
@param elementLine Header line.
@return ElementType without properties.
@throws IOException if the header line has an invalid format. | [
"Parses",
"a",
"header",
"line",
"starting",
"an",
"element",
"description",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/ElementType.java#L214-L237 |
1,977 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/RandomPlyReader.java | RandomPlyReader.getElementReader | public RandomElementReader getElementReader(final String elementType)
throws IOException {
if (elementType == null) {
throw new NullPointerException("elementType must not be null.");
}
if (!buffer.containsKey(elementType)) {
throw new IllegalArgumentException(... | java | public RandomElementReader getElementReader(final String elementType)
throws IOException {
if (elementType == null) {
throw new NullPointerException("elementType must not be null.");
}
if (!buffer.containsKey(elementType)) {
throw new IllegalArgumentException(... | [
"public",
"RandomElementReader",
"getElementReader",
"(",
"final",
"String",
"elementType",
")",
"throws",
"IOException",
"{",
"if",
"(",
"elementType",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"elementType must not be null.\"",
")",
";",... | Returns an element reader for the given element type.
@param elementType Element type.
@return Reader for the elements of the given type.
@throws IOException if reading fails.
@throws NullPointerException if {@code elementType} is {@code null}.
@throws IllegalArgumentException if there is no element with the given
name... | [
"Returns",
"an",
"element",
"reader",
"for",
"the",
"given",
"element",
"type",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/RandomPlyReader.java#L76-L94 |
1,978 | smurn/jPLY | jply/src/main/java/org/smurn/jply/Property.java | Property.parse | static Property parse(final String propertyLine) throws IOException {
if (!propertyLine.startsWith("property ")) {
throw new IOException("not a property: '"
+ propertyLine + "'");
}
String definition = propertyLine.substring("property ".length());
if (def... | java | static Property parse(final String propertyLine) throws IOException {
if (!propertyLine.startsWith("property ")) {
throw new IOException("not a property: '"
+ propertyLine + "'");
}
String definition = propertyLine.substring("property ".length());
if (def... | [
"static",
"Property",
"parse",
"(",
"final",
"String",
"propertyLine",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"propertyLine",
".",
"startsWith",
"(",
"\"property \"",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"not a property: '\"",
"+",
... | Parses a property header line.
@param propertyLine Header line.
@return Property described on the line.
@throws IOException if the header line as an invalid format. | [
"Parses",
"a",
"property",
"header",
"line",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/Property.java#L89-L117 |
1,979 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/TypeChangingElementReader.java | TypeChangingElementReader.getSourceName | private String getSourceName(final String property) {
if (propertyNameMap.containsKey(property)) {
return propertyNameMap.get(property);
} else {
return property;
}
} | java | private String getSourceName(final String property) {
if (propertyNameMap.containsKey(property)) {
return propertyNameMap.get(property);
} else {
return property;
}
} | [
"private",
"String",
"getSourceName",
"(",
"final",
"String",
"property",
")",
"{",
"if",
"(",
"propertyNameMap",
".",
"containsKey",
"(",
"property",
")",
")",
"{",
"return",
"propertyNameMap",
".",
"get",
"(",
"property",
")",
";",
"}",
"else",
"{",
"ret... | Get the name of a property in the source type.
@param property Name of the property in the target type.
@return Name of a property in the source type. | [
"Get",
"the",
"name",
"of",
"a",
"property",
"in",
"the",
"source",
"type",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/TypeChangingElementReader.java#L138-L144 |
1,980 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/AxisShufflingVertexReader.java | AxisShufflingVertexReader.getValue | private double getValue(final double x, final double y, final double z,
final Axis axis) {
switch (axis) {
case X:
return x;
case X_INVERTED:
return -x;
case Y:
return y;
case Y_INVERTED:
... | java | private double getValue(final double x, final double y, final double z,
final Axis axis) {
switch (axis) {
case X:
return x;
case X_INVERTED:
return -x;
case Y:
return y;
case Y_INVERTED:
... | [
"private",
"double",
"getValue",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
",",
"final",
"double",
"z",
",",
"final",
"Axis",
"axis",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"X",
":",
"return",
"x",
";",
"case",
"X_INVERTED... | Returns the value of a given axis.
@param x Input x value.
@param y Input y value.
@param z Input z value.
@param axis Axis to return.
@return The value of a given axis. | [
"Returns",
"the",
"value",
"of",
"a",
"given",
"axis",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/AxisShufflingVertexReader.java#L110-L128 |
1,981 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/NormalGenerator.java | NormalGenerator.generateNormals | public void generateNormals(final RandomElementReader vertexReader,
final ElementReader faceReader) throws IOException {
if (vertexReader == null) {
throw new NullPointerException("vertexReader must not be null.");
}
if (faceReader == null) {
throw new NullPoi... | java | public void generateNormals(final RandomElementReader vertexReader,
final ElementReader faceReader) throws IOException {
if (vertexReader == null) {
throw new NullPointerException("vertexReader must not be null.");
}
if (faceReader == null) {
throw new NullPoi... | [
"public",
"void",
"generateNormals",
"(",
"final",
"RandomElementReader",
"vertexReader",
",",
"final",
"ElementReader",
"faceReader",
")",
"throws",
"IOException",
"{",
"if",
"(",
"vertexReader",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
... | Performs the normal generation.
@param vertexReader Reader providing the vertices.
@param faceReader Reader providing the faces.
@throws IOException if reading fails.
@throws NullPointerException if {@code vertexReader} or
{@code faceReader} is {@code null}.
@throws IllegalArgumentException if
<ul>
<li>The vertex reade... | [
"Performs",
"the",
"normal",
"generation",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/NormalGenerator.java#L80-L132 |
1,982 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/NormalGenerator.java | NormalGenerator.normalize | private void normalize(final Element vertex) {
double nx = vertex.getDouble("nx");
double ny = vertex.getDouble("ny");
double nz = vertex.getDouble("nz");
double n = Math.sqrt(nx * nx + ny * ny + nz * nz);
if (n < EPSILON) {
vertex.setDouble("nx", 0);
vert... | java | private void normalize(final Element vertex) {
double nx = vertex.getDouble("nx");
double ny = vertex.getDouble("ny");
double nz = vertex.getDouble("nz");
double n = Math.sqrt(nx * nx + ny * ny + nz * nz);
if (n < EPSILON) {
vertex.setDouble("nx", 0);
vert... | [
"private",
"void",
"normalize",
"(",
"final",
"Element",
"vertex",
")",
"{",
"double",
"nx",
"=",
"vertex",
".",
"getDouble",
"(",
"\"nx\"",
")",
";",
"double",
"ny",
"=",
"vertex",
".",
"getDouble",
"(",
"\"ny\"",
")",
";",
"double",
"nz",
"=",
"verte... | Normalizes the normal vector of a vertex.
@param vertex Vertex to normalize. | [
"Normalizes",
"the",
"normal",
"vector",
"of",
"a",
"vertex",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/NormalGenerator.java#L138-L151 |
1,983 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/NormalGenerator.java | NormalGenerator.accumulateNormals | private void accumulateNormals(final RandomElementReader vertices,
final Element face) throws IOException {
int[] indices = face.getIntList("vertex_index");
for (int i = 0; i < indices.length; i++) {
int pre;
int post;
if (counterClockwise) {
... | java | private void accumulateNormals(final RandomElementReader vertices,
final Element face) throws IOException {
int[] indices = face.getIntList("vertex_index");
for (int i = 0; i < indices.length; i++) {
int pre;
int post;
if (counterClockwise) {
... | [
"private",
"void",
"accumulateNormals",
"(",
"final",
"RandomElementReader",
"vertices",
",",
"final",
"Element",
"face",
")",
"throws",
"IOException",
"{",
"int",
"[",
"]",
"indices",
"=",
"face",
".",
"getIntList",
"(",
"\"vertex_index\"",
")",
";",
"for",
"... | Calculate the face normal, weight by angle and add them to
the vertices.
@param vertices Vertices buffer.
@param face Face to process.
@throws IOException if reading fails. | [
"Calculate",
"the",
"face",
"normal",
"weight",
"by",
"angle",
"and",
"add",
"them",
"to",
"the",
"vertices",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/NormalGenerator.java#L160-L186 |
1,984 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/NormalGenerator.java | NormalGenerator.accumulateNormal | private void accumulateNormal(final Element center, final Element pre,
final Element post) {
double cx = center.getDouble("x");
double cy = center.getDouble("y");
double cz = center.getDouble("z");
double ax = post.getDouble("x") - cx;
double ay = post.getDouble("y")... | java | private void accumulateNormal(final Element center, final Element pre,
final Element post) {
double cx = center.getDouble("x");
double cy = center.getDouble("y");
double cz = center.getDouble("z");
double ax = post.getDouble("x") - cx;
double ay = post.getDouble("y")... | [
"private",
"void",
"accumulateNormal",
"(",
"final",
"Element",
"center",
",",
"final",
"Element",
"pre",
",",
"final",
"Element",
"post",
")",
"{",
"double",
"cx",
"=",
"center",
".",
"getDouble",
"(",
"\"x\"",
")",
";",
"double",
"cy",
"=",
"center",
"... | Calculate the face normal, weight by angle and add them to
the vertex.
@param center Vertex for which to sum the normal.
@param pre Neighbor vertex on the face.
@param post Neighbor vertex on the face. | [
"Calculate",
"the",
"face",
"normal",
"weight",
"by",
"angle",
"and",
"add",
"them",
"to",
"the",
"vertex",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/NormalGenerator.java#L195-L242 |
1,985 | smurn/jPLY | LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java | LWJGLDemo.fillBuffers | private static RectBounds fillBuffers(
PlyReader plyReader,
FloatBuffer vertexBuffer,
IntBuffer indexBuffer) throws IOException {
// Get all element readers and find the two providing
// the vertices and triangles.
ElementReader reader = plyReader.nextElemen... | java | private static RectBounds fillBuffers(
PlyReader plyReader,
FloatBuffer vertexBuffer,
IntBuffer indexBuffer) throws IOException {
// Get all element readers and find the two providing
// the vertices and triangles.
ElementReader reader = plyReader.nextElemen... | [
"private",
"static",
"RectBounds",
"fillBuffers",
"(",
"PlyReader",
"plyReader",
",",
"FloatBuffer",
"vertexBuffer",
",",
"IntBuffer",
"indexBuffer",
")",
"throws",
"IOException",
"{",
"// Get all element readers and find the two providing ",
"// the vertices and triangles.",
"... | Loads the data from the PLY file into the buffers. | [
"Loads",
"the",
"data",
"from",
"the",
"PLY",
"file",
"into",
"the",
"buffers",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java#L249-L269 |
1,986 | smurn/jPLY | LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java | LWJGLDemo.fillVertexBuffer | private static RectBounds fillVertexBuffer(
ElementReader reader,
FloatBuffer vertexBuffer) throws IOException {
// Just go though the vertices and store the coordinates in the buffer.
Element vertex = reader.readElement();
RectBounds bounds = new RectBounds();
w... | java | private static RectBounds fillVertexBuffer(
ElementReader reader,
FloatBuffer vertexBuffer) throws IOException {
// Just go though the vertices and store the coordinates in the buffer.
Element vertex = reader.readElement();
RectBounds bounds = new RectBounds();
w... | [
"private",
"static",
"RectBounds",
"fillVertexBuffer",
"(",
"ElementReader",
"reader",
",",
"FloatBuffer",
"vertexBuffer",
")",
"throws",
"IOException",
"{",
"// Just go though the vertices and store the coordinates in the buffer.",
"Element",
"vertex",
"=",
"reader",
".",
"r... | Fill the vertex buffer with the data from the PLY file. | [
"Fill",
"the",
"vertex",
"buffer",
"with",
"the",
"data",
"from",
"the",
"PLY",
"file",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java#L274-L298 |
1,987 | smurn/jPLY | LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java | LWJGLDemo.fillIndexBuffer | private static void fillIndexBuffer(
ElementReader reader,
IntBuffer indexBuffer) throws IOException {
// Just go though the triangles and store the indices in the buffer.
Element triangle = reader.readElement();
while (triangle != null) {
int[] indices = tr... | java | private static void fillIndexBuffer(
ElementReader reader,
IntBuffer indexBuffer) throws IOException {
// Just go though the triangles and store the indices in the buffer.
Element triangle = reader.readElement();
while (triangle != null) {
int[] indices = tr... | [
"private",
"static",
"void",
"fillIndexBuffer",
"(",
"ElementReader",
"reader",
",",
"IntBuffer",
"indexBuffer",
")",
"throws",
"IOException",
"{",
"// Just go though the triangles and store the indices in the buffer.",
"Element",
"triangle",
"=",
"reader",
".",
"readElement"... | Fill the index buffer with the data from the PLY file. | [
"Fill",
"the",
"index",
"buffer",
"with",
"the",
"data",
"from",
"the",
"PLY",
"file",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java#L303-L318 |
1,988 | smurn/jPLY | LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java | LWJGLDemo.createShaders | private static int createShaders() throws IOException {
// load and compile the vertex shader.
String vertexShaderCode = IOUtils.toString(
ClassLoader.getSystemResourceAsStream("vertexShader.glsl"));
int vertexShaderId = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
glS... | java | private static int createShaders() throws IOException {
// load and compile the vertex shader.
String vertexShaderCode = IOUtils.toString(
ClassLoader.getSystemResourceAsStream("vertexShader.glsl"));
int vertexShaderId = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
glS... | [
"private",
"static",
"int",
"createShaders",
"(",
")",
"throws",
"IOException",
"{",
"// load and compile the vertex shader.",
"String",
"vertexShaderCode",
"=",
"IOUtils",
".",
"toString",
"(",
"ClassLoader",
".",
"getSystemResourceAsStream",
"(",
"\"vertexShader.glsl\"",
... | Loads the vertex and fragment shader. | [
"Loads",
"the",
"vertex",
"and",
"fragment",
"shader",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java#L323-L350 |
1,989 | smurn/jPLY | LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java | LWJGLDemo.printLogInfo | private static boolean printLogInfo(int obj) {
IntBuffer iVal = BufferUtils.createIntBuffer(1);
ARBShaderObjects.glGetObjectParameterARB(obj,
ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB, iVal);
int length = iVal.get();
if (length > 1) {
// We have some inf... | java | private static boolean printLogInfo(int obj) {
IntBuffer iVal = BufferUtils.createIntBuffer(1);
ARBShaderObjects.glGetObjectParameterARB(obj,
ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB, iVal);
int length = iVal.get();
if (length > 1) {
// We have some inf... | [
"private",
"static",
"boolean",
"printLogInfo",
"(",
"int",
"obj",
")",
"{",
"IntBuffer",
"iVal",
"=",
"BufferUtils",
".",
"createIntBuffer",
"(",
"1",
")",
";",
"ARBShaderObjects",
".",
"glGetObjectParameterARB",
"(",
"obj",
",",
"ARBShaderObjects",
".",
"GL_OB... | Helper to get the log messages from the shader compiler. | [
"Helper",
"to",
"get",
"the",
"log",
"messages",
"from",
"the",
"shader",
"compiler",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/LWJGLDemo.java#L355-L374 |
1,990 | smurn/jPLY | jply/src/main/java/org/smurn/jply/UnbufferedASCIIReader.java | UnbufferedASCIIReader.readLine | public String readLine() throws IOException {
StringBuilder str = new StringBuilder();
while (true) {
int c = read();
if (c < 0) {
break;
}
if (c == '\n') {
// if possible consume another '\r'
int peek = stre... | java | public String readLine() throws IOException {
StringBuilder str = new StringBuilder();
while (true) {
int c = read();
if (c < 0) {
break;
}
if (c == '\n') {
// if possible consume another '\r'
int peek = stre... | [
"public",
"String",
"readLine",
"(",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"str",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"while",
"(",
"true",
")",
"{",
"int",
"c",
"=",
"read",
"(",
")",
";",
"if",
"(",
"c",
"<",
"0",
")",
"{",
... | Reads the next line.
@return The next line or {@code null} if the end of the stream is
reached.
@throws IOException if reading fails. | [
"Reads",
"the",
"next",
"line",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/UnbufferedASCIIReader.java#L52-L78 |
1,991 | smurn/jPLY | LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/RectBounds.java | RectBounds.getScaleToUnityBox | public double getScaleToUnityBox(){
double largestEdge = 0;
largestEdge = Math.max(largestEdge, maxX - minX);
largestEdge = Math.max(largestEdge, maxY - minY);
largestEdge = Math.max(largestEdge, maxZ - minZ);
return 1.0 / largestEdge;
} | java | public double getScaleToUnityBox(){
double largestEdge = 0;
largestEdge = Math.max(largestEdge, maxX - minX);
largestEdge = Math.max(largestEdge, maxY - minY);
largestEdge = Math.max(largestEdge, maxZ - minZ);
return 1.0 / largestEdge;
} | [
"public",
"double",
"getScaleToUnityBox",
"(",
")",
"{",
"double",
"largestEdge",
"=",
"0",
";",
"largestEdge",
"=",
"Math",
".",
"max",
"(",
"largestEdge",
",",
"maxX",
"-",
"minX",
")",
";",
"largestEdge",
"=",
"Math",
".",
"max",
"(",
"largestEdge",
"... | Gets the scale factor by which the box needs to be multiplied
that it fits into a cube with edge length 1. | [
"Gets",
"the",
"scale",
"factor",
"by",
"which",
"the",
"box",
"needs",
"to",
"be",
"multiplied",
"that",
"it",
"fits",
"into",
"a",
"cube",
"with",
"edge",
"length",
"1",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/LWJGLDemo/src/main/java/org/smurn/jply/lwjgldemo/RectBounds.java#L99-L105 |
1,992 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/NormalizingPlyReader.java | NormalizingPlyReader.addNormalProps | private static ElementType addNormalProps(final ElementType sourceType) {
List<Property> properties = new ArrayList<Property>();
boolean foundNX = false;
boolean foundNY = false;
boolean foundNZ = false;
for (Property property : sourceType.getProperties()) {
if (prope... | java | private static ElementType addNormalProps(final ElementType sourceType) {
List<Property> properties = new ArrayList<Property>();
boolean foundNX = false;
boolean foundNY = false;
boolean foundNZ = false;
for (Property property : sourceType.getProperties()) {
if (prope... | [
"private",
"static",
"ElementType",
"addNormalProps",
"(",
"final",
"ElementType",
"sourceType",
")",
"{",
"List",
"<",
"Property",
">",
"properties",
"=",
"new",
"ArrayList",
"<",
"Property",
">",
"(",
")",
";",
"boolean",
"foundNX",
"=",
"false",
";",
"boo... | Adds properties for nx, ny and nz if they don't already exist.
@param sourceType Source vertex type.
@return Vertex type guaranteed to have nx, ny and nz. | [
"Adds",
"properties",
"for",
"nx",
"ny",
"and",
"nz",
"if",
"they",
"don",
"t",
"already",
"exist",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/NormalizingPlyReader.java#L262-L292 |
1,993 | smurn/jPLY | jply/src/main/java/org/smurn/jply/util/NormalizingPlyReader.java | NormalizingPlyReader.addTextureProps | private static ElementType addTextureProps(final ElementType sourceType) {
List<Property> properties = new ArrayList<Property>();
boolean foundU = false;
boolean foundV = false;
for (Property property : sourceType.getProperties()) {
if (property.getName().equals("u")) {
... | java | private static ElementType addTextureProps(final ElementType sourceType) {
List<Property> properties = new ArrayList<Property>();
boolean foundU = false;
boolean foundV = false;
for (Property property : sourceType.getProperties()) {
if (property.getName().equals("u")) {
... | [
"private",
"static",
"ElementType",
"addTextureProps",
"(",
"final",
"ElementType",
"sourceType",
")",
"{",
"List",
"<",
"Property",
">",
"properties",
"=",
"new",
"ArrayList",
"<",
"Property",
">",
"(",
")",
";",
"boolean",
"foundU",
"=",
"false",
";",
"boo... | Adds properties for u and v if they don't already exist.
@param sourceType Source vertex type.
@return Vertex type guaranteed to have u and v. | [
"Adds",
"properties",
"for",
"u",
"and",
"v",
"if",
"they",
"don",
"t",
"already",
"exist",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/util/NormalizingPlyReader.java#L299-L323 |
1,994 | smurn/jPLY | jply/src/main/java/org/smurn/jply/Element.java | Element.setDouble | public void setDouble(final String propertyName, final double value) {
if (propertyName == null) {
throw new NullPointerException("propertyName must not be null.");
}
Integer index = propertyMap.get(propertyName);
if (index == null) {
throw new IllegalArgumentExce... | java | public void setDouble(final String propertyName, final double value) {
if (propertyName == null) {
throw new NullPointerException("propertyName must not be null.");
}
Integer index = propertyMap.get(propertyName);
if (index == null) {
throw new IllegalArgumentExce... | [
"public",
"void",
"setDouble",
"(",
"final",
"String",
"propertyName",
",",
"final",
"double",
"value",
")",
"{",
"if",
"(",
"propertyName",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"propertyName must not be null.\"",
")",
";",
"}",... | Sets the value of a property-list.
If the property is a list, the list will be set to a single entry.
@param propertyName Name of the property to set.
@param value Value to set for that property.
@throws NullPointerException if {@code propertyName} is {@code null}.
@throws IllegalArgumentException if the element type d... | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"-",
"list",
".",
"If",
"the",
"property",
"is",
"a",
"list",
"the",
"list",
"will",
"be",
"set",
"to",
"a",
"single",
"entry",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/Element.java#L221-L231 |
1,995 | smurn/jPLY | jply/src/main/java/org/smurn/jply/ListProperty.java | ListProperty.parse | static Property parse(final String line) throws IOException {
if (!line.startsWith("property ")) {
throw new IOException("not a property: '"
+ line + "'");
}
String definition = line.substring("property ".length());
definition = definition.trim();
... | java | static Property parse(final String line) throws IOException {
if (!line.startsWith("property ")) {
throw new IOException("not a property: '"
+ line + "'");
}
String definition = line.substring("property ".length());
definition = definition.trim();
... | [
"static",
"Property",
"parse",
"(",
"final",
"String",
"line",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"line",
".",
"startsWith",
"(",
"\"property \"",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"not a property: '\"",
"+",
"line",
"+",
... | Parses a list-property header line.
@param line Header line.
@return Property described on the line.
@throws IOException if the header line as an invalid format. | [
"Parses",
"a",
"list",
"-",
"property",
"header",
"line",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/ListProperty.java#L68-L103 |
1,996 | smurn/jPLY | jply/src/main/java/org/smurn/jply/PlyReaderFile.java | PlyReaderFile.getElementCount | @Override
public int getElementCount(final String elementType) {
if (elementType == null) {
throw new IllegalArgumentException("elementType must not be null.");
}
Integer count = elementCounts.get(elementType);
if (count == null) {
throw new IllegalArgumentExc... | java | @Override
public int getElementCount(final String elementType) {
if (elementType == null) {
throw new IllegalArgumentException("elementType must not be null.");
}
Integer count = elementCounts.get(elementType);
if (count == null) {
throw new IllegalArgumentExc... | [
"@",
"Override",
"public",
"int",
"getElementCount",
"(",
"final",
"String",
"elementType",
")",
"{",
"if",
"(",
"elementType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"elementType must not be null.\"",
")",
";",
"}",
"Integer",
... | Gets the number of elements for a given element type.
@param elementType Name of the element type.
@return Number of elements of the given type.
@throws NullPointerException if {@code elementType} is {@code null}.
@throws IllegalArgumentException if there is no such type in this
file. | [
"Gets",
"the",
"number",
"of",
"elements",
"for",
"a",
"given",
"element",
"type",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/PlyReaderFile.java#L224-L236 |
1,997 | smurn/jPLY | jply/src/main/java/org/smurn/jply/PlyReaderFile.java | PlyReaderFile.nextElementReaderInternal | private ElementReader nextElementReaderInternal() {
if (nextElement >= elements.size()) {
return null;
}
try {
ElementType type = elements.get(nextElement);
switch (format) {
case ASCII:
return new AsciiElementReader(
... | java | private ElementReader nextElementReaderInternal() {
if (nextElement >= elements.size()) {
return null;
}
try {
ElementType type = elements.get(nextElement);
switch (format) {
case ASCII:
return new AsciiElementReader(
... | [
"private",
"ElementReader",
"nextElementReaderInternal",
"(",
")",
"{",
"if",
"(",
"nextElement",
">=",
"elements",
".",
"size",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"ElementType",
"type",
"=",
"elements",
".",
"get",
"(",
"nextEleme... | Creates the next element reader.
@return next element Reader. | [
"Creates",
"the",
"next",
"element",
"reader",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/PlyReaderFile.java#L286-L312 |
1,998 | smurn/jPLY | jply/src/main/java/org/smurn/jply/BinaryPlyInputStream.java | BinaryPlyInputStream.read | public double read(final DataType type) throws IOException {
if (type == null) {
throw new NullPointerException("type must not be null.");
}
switch (type) {
case CHAR:
ensureAvailable(1);
return buffer.get();
case UCHAR:
... | java | public double read(final DataType type) throws IOException {
if (type == null) {
throw new NullPointerException("type must not be null.");
}
switch (type) {
case CHAR:
ensureAvailable(1);
return buffer.get();
case UCHAR:
... | [
"public",
"double",
"read",
"(",
"final",
"DataType",
"type",
")",
"throws",
"IOException",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"type must not be null.\"",
")",
";",
"}",
"switch",
"(",
"type",
")",
... | Reads a value from the stream.
@param type Encoding of the value in the binary stream.
@return Value casted to {@code double}.
@throws IOException if reading the value fails.
@throws NullPointerException if {@code type} is {@code null}. | [
"Reads",
"a",
"value",
"from",
"the",
"stream",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/BinaryPlyInputStream.java#L65-L97 |
1,999 | smurn/jPLY | jply/src/main/java/org/smurn/jply/BinaryPlyInputStream.java | BinaryPlyInputStream.ensureAvailable | private void ensureAvailable(final int bytes) throws IOException {
while (buffer.remaining() < bytes) {
buffer.compact();
if (channel.read(buffer) < 0) {
throw new EOFException();
}
buffer.flip();
}
} | java | private void ensureAvailable(final int bytes) throws IOException {
while (buffer.remaining() < bytes) {
buffer.compact();
if (channel.read(buffer) < 0) {
throw new EOFException();
}
buffer.flip();
}
} | [
"private",
"void",
"ensureAvailable",
"(",
"final",
"int",
"bytes",
")",
"throws",
"IOException",
"{",
"while",
"(",
"buffer",
".",
"remaining",
"(",
")",
"<",
"bytes",
")",
"{",
"buffer",
".",
"compact",
"(",
")",
";",
"if",
"(",
"channel",
".",
"read... | Ensures that a certain amount of bytes are in the buffer, ready
to be read.
@param bytes Minimal number of unread bytes required in the buffer.
@see ByteBuffer#remaining()
@throws IOException if reading sufficient more data into the buffer
fails. | [
"Ensures",
"that",
"a",
"certain",
"amount",
"of",
"bytes",
"are",
"in",
"the",
"buffer",
"ready",
"to",
"be",
"read",
"."
] | 77cb8c47fff7549ae1da8d8568ad8bdf374fe89f | https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/BinaryPlyInputStream.java#L107-L115 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.