repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.getStyle
private Style getStyle() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.bottom_sheet_style_preference_key); String defaultValue = getString(R.string.bottom_sheet_style_preference_default_value)...
java
private Style getStyle() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.bottom_sheet_style_preference_key); String defaultValue = getString(R.string.bottom_sheet_style_preference_default_value)...
[ "private", "Style", "getStyle", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "botto...
Returns the style, which should be used to create bottom sheets, depending on the app's settings. @return The style, which should be used to create bottom sheets, as a value of the enum {@link Style}
[ "Returns", "the", "style", "which", "should", "be", "used", "to", "create", "bottom", "sheets", "depending", "on", "the", "app", "s", "settings", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L302-L317
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.shouldTitleBeShown
private boolean shouldTitleBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_bottom_sheet_title_preference_key); boolean defaultValue = getResources().getBoolean(R.b...
java
private boolean shouldTitleBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_bottom_sheet_title_preference_key); boolean defaultValue = getResources().getBoolean(R.b...
[ "private", "boolean", "shouldTitleBeShown", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", "...
Returns, whether the title of bottom sheets should be shown, depending on the app's settings, or not. @return True, if the title of bottom sheets should be shown, false otherwise
[ "Returns", "whether", "the", "title", "of", "bottom", "sheets", "should", "be", "shown", "depending", "on", "the", "app", "s", "settings", "or", "not", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L325-L332
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.getBottomSheetTitle
private String getBottomSheetTitle() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.bottom_sheet_title_preference_key); String defaultValue = getString(R.string.bottom_sheet_title_preference_de...
java
private String getBottomSheetTitle() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.bottom_sheet_title_preference_key); String defaultValue = getString(R.string.bottom_sheet_title_preference_de...
[ "private", "String", "getBottomSheetTitle", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", "...
Returns the title of bottom sheets, depending on the app's settings. @return The title of the bottom sheets
[ "Returns", "the", "title", "of", "bottom", "sheets", "depending", "on", "the", "app", "s", "settings", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L339-L345
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.shouldIconBeShown
private boolean shouldIconBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_bottom_sheet_icon_preference_key); boolean defaultValue = getResources().getBoolean(R.boo...
java
private boolean shouldIconBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_bottom_sheet_icon_preference_key); boolean defaultValue = getResources().getBoolean(R.boo...
[ "private", "boolean", "shouldIconBeShown", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", "....
Returns, whether the icon of bottom sheets should be shown, depending on the app's settings, or not. @return True, if the icon of bottom sheets should be shown, false otherwise
[ "Returns", "whether", "the", "icon", "of", "bottom", "sheets", "should", "be", "shown", "depending", "on", "the", "app", "s", "settings", "or", "not", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L353-L360
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.getDividerCount
private int getDividerCount() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.divider_count_preference_key); String defaultValue = getString(R.string.divider_count_preference_default_value); ...
java
private int getDividerCount() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.divider_count_preference_key); String defaultValue = getString(R.string.divider_count_preference_default_value); ...
[ "private", "int", "getDividerCount", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "...
Returns the number of dividers, which should be shown, depending on the app's settings. @return The number of dividers, which should be shown, as an {@link Integer} value
[ "Returns", "the", "number", "of", "dividers", "which", "should", "be", "shown", "depending", "on", "the", "app", "s", "settings", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L367-L373
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.shouldDividerTitleBeShown
private boolean shouldDividerTitleBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_divider_title_preference_key); boolean defaultValue = getResources().getBoolean(R...
java
private boolean shouldDividerTitleBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_divider_title_preference_key); boolean defaultValue = getResources().getBoolean(R...
[ "private", "boolean", "shouldDividerTitleBeShown", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "strin...
Returns, whether the title of dividers should be shown, depending on the app's settings, or not. @return True, if the title of dividers should be shown, false otherwise
[ "Returns", "whether", "the", "title", "of", "dividers", "should", "be", "shown", "depending", "on", "the", "app", "s", "settings", "or", "not", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L381-L388
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.getItemCount
private int getItemCount() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.item_count_preference_key); String defaultValue = getString(R.string.item_count_preference_default_value); retu...
java
private int getItemCount() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.item_count_preference_key); String defaultValue = getString(R.string.item_count_preference_default_value); retu...
[ "private", "int", "getItemCount", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "ite...
Returns the number of items, which should be shown per divider, depending on the app's settings. @return The number of items, which should be shown per divider, as an {@link Integer} value
[ "Returns", "the", "number", "of", "items", "which", "should", "be", "shown", "per", "divider", "depending", "on", "the", "app", "s", "settings", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L396-L402
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.shouldItemIconsBeShown
private boolean shouldItemIconsBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_item_icons_preference_key); boolean defaultValue = getResources().getBoolean(R.bool....
java
private boolean shouldItemIconsBeShown() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.show_item_icons_preference_key); boolean defaultValue = getResources().getBoolean(R.bool....
[ "private", "boolean", "shouldItemIconsBeShown", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string",...
Returns, whether icons should be shown next to items, depending on the app's settings, or not. @return True, if icons should be shown next to items, false otherwise
[ "Returns", "whether", "icons", "should", "be", "shown", "next", "to", "items", "depending", "on", "the", "app", "s", "settings", "or", "not", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L410-L417
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.shouldItemsBeDisabled
private boolean shouldItemsBeDisabled() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.disable_items_preference_key); boolean defaultValue = getResources().getBoolean(R.bool.dis...
java
private boolean shouldItemsBeDisabled() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.disable_items_preference_key); boolean defaultValue = getResources().getBoolean(R.bool.dis...
[ "private", "boolean", "shouldItemsBeDisabled", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", ...
Returns, whether items should be disabled, depending on the app's settings, or not. @return True, if items should be disabled, false otherwise.
[ "Returns", "whether", "items", "should", "be", "disabled", "depending", "on", "the", "app", "s", "settings", "or", "not", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L424-L431
train
michael-rapp/AndroidBottomSheet
example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java
PreferenceFragment.isDarkThemeSet
private boolean isDarkThemeSet() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.theme_preference_key); String defaultValue = getString(R.string.theme_preference_default_value); return I...
java
private boolean isDarkThemeSet() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String key = getString(R.string.theme_preference_key); String defaultValue = getString(R.string.theme_preference_default_value); return I...
[ "private", "boolean", "isDarkThemeSet", "(", ")", "{", "SharedPreferences", "sharedPreferences", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getActivity", "(", ")", ")", ";", "String", "key", "=", "getString", "(", "R", ".", "string", ".", ...
Returns, whether the app uses the dark theme, or not. @return True, if the app uses the dark theme, false otherwise
[ "Returns", "whether", "the", "app", "uses", "the", "dark", "theme", "or", "not", "." ]
6e4690ee9f63b14a7b143d3a3717b5f8a11ca503
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/example/src/main/java/de/mrapp/android/bottomsheet/example/PreferenceFragment.java#L438-L444
train
codecentric/zucchini
zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java
TokenList.detectVariableValues
public Map<String, String> detectVariableValues(TokenList tokenList) { Map<String, String> variables = new HashMap<String, String>(); boolean thisContainsVariables = containsVariables(); boolean thatContainsVariables = tokenList.containsVariables(); // If both lists contain variables, ...
java
public Map<String, String> detectVariableValues(TokenList tokenList) { Map<String, String> variables = new HashMap<String, String>(); boolean thisContainsVariables = containsVariables(); boolean thatContainsVariables = tokenList.containsVariables(); // If both lists contain variables, ...
[ "public", "Map", "<", "String", ",", "String", ">", "detectVariableValues", "(", "TokenList", "tokenList", ")", "{", "Map", "<", "String", ",", "String", ">", "variables", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "boolean"...
Detects variable values using another token list. Usually, one is working with two token lists. One list contains literals and variables and the other token list contains only literals. Both lists match are then compared to find values (literals of the second list) for variables in the first list. Example: - Token li...
[ "Detects", "variable", "values", "using", "another", "token", "list", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java#L51-L82
train
codecentric/zucchini
zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java
TokenList.tokenTypesMatch
private boolean tokenTypesMatch(Token token1, Token token2, Class<? extends Token> tokenType) { return tokenType.isAssignableFrom(token1.getClass()) && tokenType.isAssignableFrom(token2.getClass()); }
java
private boolean tokenTypesMatch(Token token1, Token token2, Class<? extends Token> tokenType) { return tokenType.isAssignableFrom(token1.getClass()) && tokenType.isAssignableFrom(token2.getClass()); }
[ "private", "boolean", "tokenTypesMatch", "(", "Token", "token1", ",", "Token", "token2", ",", "Class", "<", "?", "extends", "Token", ">", "tokenType", ")", "{", "return", "tokenType", ".", "isAssignableFrom", "(", "token1", ".", "getClass", "(", ")", ")", ...
Checks whether both tokens have the specified type. @param token1 The first token to check. @param token2 The second token to check. @param tokenType The type that both tokens must have. @return {@literal true} if both tokens have the specified type, and {@literal false} otherwise.
[ "Checks", "whether", "both", "tokens", "have", "the", "specified", "type", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java#L197-L199
train
codecentric/zucchini
zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java
TokenList.tokenTextsDoNotMatch
private boolean tokenTextsDoNotMatch(Token token1, Token token2) { return !token1.getText().equals(token2.getText()); }
java
private boolean tokenTextsDoNotMatch(Token token1, Token token2) { return !token1.getText().equals(token2.getText()); }
[ "private", "boolean", "tokenTextsDoNotMatch", "(", "Token", "token1", ",", "Token", "token2", ")", "{", "return", "!", "token1", ".", "getText", "(", ")", ".", "equals", "(", "token2", ".", "getText", "(", ")", ")", ";", "}" ]
Checks whether both tokens have the same texts. @param token1 The first token to check. @param token2 The second token to check. @return {@literal true} if the tokens do not have the same texts, and {@literal false} otherwise.
[ "Checks", "whether", "both", "tokens", "have", "the", "same", "texts", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java#L208-L210
train
codecentric/zucchini
zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/StatementResolverHolder.java
StatementResolverHolder.setStatementResolver
@SuppressWarnings("WeakerAccess") public static void setStatementResolver(StatementResolver statementResolver) { if (statementResolver == null) { throw new NullPointerException("The statement resolver must not be null."); } StatementResolverHolder.STATEMENT_RESOLVER.set(statement...
java
@SuppressWarnings("WeakerAccess") public static void setStatementResolver(StatementResolver statementResolver) { if (statementResolver == null) { throw new NullPointerException("The statement resolver must not be null."); } StatementResolverHolder.STATEMENT_RESOLVER.set(statement...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "static", "void", "setStatementResolver", "(", "StatementResolver", "statementResolver", ")", "{", "if", "(", "statementResolver", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "...
Sets the statement resolver for the current thread. @param statementResolver The statement resolver for the current thread.
[ "Sets", "the", "statement", "resolver", "for", "the", "current", "thread", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/StatementResolverHolder.java#L47-L53
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/util/WebAssert.java
WebAssert.findElementOrFail
public static WebElement findElementOrFail(WebDriver webDriver, By element) { try { return webDriver.findElement(element); } catch (NoSuchElementException e) { fail(String.format("Element %s should exist but it does not.", element.toString()), e); } /** * Never reached since {@link de.codecentric.zucch...
java
public static WebElement findElementOrFail(WebDriver webDriver, By element) { try { return webDriver.findElement(element); } catch (NoSuchElementException e) { fail(String.format("Element %s should exist but it does not.", element.toString()), e); } /** * Never reached since {@link de.codecentric.zucch...
[ "public", "static", "WebElement", "findElementOrFail", "(", "WebDriver", "webDriver", ",", "By", "element", ")", "{", "try", "{", "return", "webDriver", ".", "findElement", "(", "element", ")", ";", "}", "catch", "(", "NoSuchElementException", "e", ")", "{", ...
Tries to find a specific element and fails if the element could not be found. @param webDriver The web driver. @param element The element. @return The found element.
[ "Tries", "to", "find", "a", "specific", "element", "and", "fails", "if", "the", "element", "could", "not", "be", "found", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/util/WebAssert.java#L37-L48
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/TypeStep.java
TypeStep.go
@Override public void go() { logger.info("Typing \"{}\"...", (Object) keys); new Actions(getWebDriver()).sendKeys(Keys.ENTER); }
java
@Override public void go() { logger.info("Typing \"{}\"...", (Object) keys); new Actions(getWebDriver()).sendKeys(Keys.ENTER); }
[ "@", "Override", "public", "void", "go", "(", ")", "{", "logger", ".", "info", "(", "\"Typing \\\"{}\\\"...\"", ",", "(", "Object", ")", "keys", ")", ";", "new", "Actions", "(", "getWebDriver", "(", ")", ")", ".", "sendKeys", "(", "Keys", ".", "ENTER",...
Types the keys.
[ "Types", "the", "keys", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/TypeStep.java#L69-L73
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/WebDriverExecutor.java
WebDriverExecutor.failOnInvalidContext
protected void failOnInvalidContext(ExecutionContext executionContext) { for (Fact fact : executionContext.getFacts()) { failOnInvalidFact(fact); } for (Step step : executionContext.getSteps()) { failOnInvalidStep(step); } for (Result result : executionContext.getResults()) { failOnInvalidResult(resu...
java
protected void failOnInvalidContext(ExecutionContext executionContext) { for (Fact fact : executionContext.getFacts()) { failOnInvalidFact(fact); } for (Step step : executionContext.getSteps()) { failOnInvalidStep(step); } for (Result result : executionContext.getResults()) { failOnInvalidResult(resu...
[ "protected", "void", "failOnInvalidContext", "(", "ExecutionContext", "executionContext", ")", "{", "for", "(", "Fact", "fact", ":", "executionContext", ".", "getFacts", "(", ")", ")", "{", "failOnInvalidFact", "(", "fact", ")", ";", "}", "for", "(", "Step", ...
This method validates the execution context. Delegating statements and prepared statements are supported. @param executionContext The context that shall be validated.
[ "This", "method", "validates", "the", "execution", "context", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/WebDriverExecutor.java#L115-L125
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/results/NotResult.java
NotResult.expect
@Override public void expect() { try { webResult.setWebDriver(getWebDriver()); webResult.expect(); fail("Result should fail but it did not."); } catch (Exception e) { logger.debug("Negated failure:", e); } catch (AssertionError e) { ...
java
@Override public void expect() { try { webResult.setWebDriver(getWebDriver()); webResult.expect(); fail("Result should fail but it did not."); } catch (Exception e) { logger.debug("Negated failure:", e); } catch (AssertionError e) { ...
[ "@", "Override", "public", "void", "expect", "(", ")", "{", "try", "{", "webResult", ".", "setWebDriver", "(", "getWebDriver", "(", ")", ")", ";", "webResult", ".", "expect", "(", ")", ";", "fail", "(", "\"Result should fail but it did not.\"", ")", ";", "...
Expects that the specified web result fails.
[ "Expects", "that", "the", "specified", "web", "result", "fails", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/results/NotResult.java#L55-L66
train
codecentric/zucchini
zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/Tokenizer.java
Tokenizer.findTokens
private void findTokens() { mergedTokens = new TokenList(); variable = null; state = TokenizerState.START; index = -1; while (index < rawTokens.length) { switch (state) { case START: next(TokenizerState.OUTSIDE_VARIABLE_CONTEXT); ...
java
private void findTokens() { mergedTokens = new TokenList(); variable = null; state = TokenizerState.START; index = -1; while (index < rawTokens.length) { switch (state) { case START: next(TokenizerState.OUTSIDE_VARIABLE_CONTEXT); ...
[ "private", "void", "findTokens", "(", ")", "{", "mergedTokens", "=", "new", "TokenList", "(", ")", ";", "variable", "=", "null", ";", "state", "=", "TokenizerState", ".", "START", ";", "index", "=", "-", "1", ";", "while", "(", "index", "<", "rawTokens...
Finds tokens within the split statement name.
[ "Finds", "tokens", "within", "the", "split", "statement", "name", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/Tokenizer.java#L138-L159
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/WaitStep.java
WaitStep.go
@Override public void go() { logger.info("Waiting {} seconds...", sleepTime); try { Thread.sleep(sleepTime); } catch (InterruptedException e) { throw new ExecutionException("Thread could not sleep.", e); } }
java
@Override public void go() { logger.info("Waiting {} seconds...", sleepTime); try { Thread.sleep(sleepTime); } catch (InterruptedException e) { throw new ExecutionException("Thread could not sleep.", e); } }
[ "@", "Override", "public", "void", "go", "(", ")", "{", "logger", ".", "info", "(", "\"Waiting {} seconds...\"", ",", "sleepTime", ")", ";", "try", "{", "Thread", ".", "sleep", "(", "sleepTime", ")", ";", "}", "catch", "(", "InterruptedException", "e", "...
Waits for the specified sleep time.
[ "Waits", "for", "the", "specified", "sleep", "time", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/WaitStep.java#L114-L122
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/TypeIntoStep.java
TypeIntoStep.go
@Override public void go() { logger.info("Typing \"{}\" into {}...", keys, element); findElementOrFail(getWebDriver(), element).sendKeys(keys); }
java
@Override public void go() { logger.info("Typing \"{}\" into {}...", keys, element); findElementOrFail(getWebDriver(), element).sendKeys(keys); }
[ "@", "Override", "public", "void", "go", "(", ")", "{", "logger", ".", "info", "(", "\"Typing \\\"{}\\\" into {}...\"", ",", "keys", ",", "element", ")", ";", "findElementOrFail", "(", "getWebDriver", "(", ")", ",", "element", ")", ".", "sendKeys", "(", "k...
Types into the element.
[ "Types", "into", "the", "element", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/TypeIntoStep.java#L68-L72
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/WaitForStep.java
WaitForStep.go
@Override public void go() { logger.info("Waiting {} seconds for {}...", timeout, element); WebDriverWait waiting = new WebDriverWait(getWebDriver(), timeout); try { waiting.until(ExpectedConditions.presenceOfElementLocated(element)); } catch (NullPointerException e) { fail(String.format("Element %s did ...
java
@Override public void go() { logger.info("Waiting {} seconds for {}...", timeout, element); WebDriverWait waiting = new WebDriverWait(getWebDriver(), timeout); try { waiting.until(ExpectedConditions.presenceOfElementLocated(element)); } catch (NullPointerException e) { fail(String.format("Element %s did ...
[ "@", "Override", "public", "void", "go", "(", ")", "{", "logger", ".", "info", "(", "\"Waiting {} seconds for {}...\"", ",", "timeout", ",", "element", ")", ";", "WebDriverWait", "waiting", "=", "new", "WebDriverWait", "(", "getWebDriver", "(", ")", ",", "ti...
Waits for the element.
[ "Waits", "for", "the", "element", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/WaitForStep.java#L116-L125
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/results/SeeResult.java
SeeResult.expect
@Override public void expect() { assertTrue(String.format("Page should contain \"%s\" but it does not.", text), getWebDriver().getPageSource().contains(text)); }
java
@Override public void expect() { assertTrue(String.format("Page should contain \"%s\" but it does not.", text), getWebDriver().getPageSource().contains(text)); }
[ "@", "Override", "public", "void", "expect", "(", ")", "{", "assertTrue", "(", "String", ".", "format", "(", "\"Page should contain \\\"%s\\\" but it does not.\"", ",", "text", ")", ",", "getWebDriver", "(", ")", ".", "getPageSource", "(", ")", ".", "contains", ...
Expects that the specified text is present.
[ "Expects", "that", "the", "specified", "text", "is", "present", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/results/SeeResult.java#L53-L56
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/SelectContext.java
SelectContext.value
public SelectStep value(String value) { return new SelectStep(element, value, SelectStep.OptionSelectorType.VALUE); }
java
public SelectStep value(String value) { return new SelectStep(element, value, SelectStep.OptionSelectorType.VALUE); }
[ "public", "SelectStep", "value", "(", "String", "value", ")", "{", "return", "new", "SelectStep", "(", "element", ",", "value", ",", "SelectStep", ".", "OptionSelectorType", ".", "VALUE", ")", ";", "}" ]
Selects an option by its value. @param value The value of the option that shall be selected. @return A {@link de.codecentric.zucchini.web.steps.SelectStep} that selects an option by its value.
[ "Selects", "an", "option", "by", "its", "value", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/SelectContext.java#L62-L64
train
codecentric/zucchini
zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/SelectContext.java
SelectContext.text
public SelectStep text(String text) { return new SelectStep(element, text, SelectStep.OptionSelectorType.TEXT); }
java
public SelectStep text(String text) { return new SelectStep(element, text, SelectStep.OptionSelectorType.TEXT); }
[ "public", "SelectStep", "text", "(", "String", "text", ")", "{", "return", "new", "SelectStep", "(", "element", ",", "text", ",", "SelectStep", ".", "OptionSelectorType", ".", "TEXT", ")", ";", "}" ]
Selects an option by its text. @param text The text of the option that shall be selected. @return A {@link de.codecentric.zucchini.web.steps.SelectStep} that selects an option by its text.
[ "Selects", "an", "option", "by", "its", "text", "." ]
61541cd8ce666ef21ad943486a7c0eb53310ed5a
https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/steps/SelectContext.java#L72-L74
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/controller/ApiController.java
ApiController.api
@SuppressWarnings({ "resource" }) @RequestMapping(value = { "/api.js", "/api-debug.js", "/api-debug-doc.js" }, method = RequestMethod.GET) public void api(@RequestParam(value = "apiNs", required = false) String apiNs, @RequestParam(value = "actionNs", required = false) String actionNs, @RequestParam(value = ...
java
@SuppressWarnings({ "resource" }) @RequestMapping(value = { "/api.js", "/api-debug.js", "/api-debug-doc.js" }, method = RequestMethod.GET) public void api(@RequestParam(value = "apiNs", required = false) String apiNs, @RequestParam(value = "actionNs", required = false) String actionNs, @RequestParam(value = ...
[ "@", "SuppressWarnings", "(", "{", "\"resource\"", "}", ")", "@", "RequestMapping", "(", "value", "=", "{", "\"/api.js\"", ",", "\"/api-debug.js\"", ",", "\"/api-debug-doc.js\"", "}", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "void", "api...
Method that handles api.js and api-debug.js calls. Generates a javascript with the necessary code for Ext Direct. @param apiNs name of the namespace the variable remotingApiVar will live in. Defaults to Ext.app @param actionNs name of the namespace the action will live in. @param remotingApiVar name of the remoting ap...
[ "Method", "that", "handles", "api", ".", "js", "and", "api", "-", "debug", ".", "js", "calls", ".", "Generates", "a", "javascript", "with", "the", "necessary", "code", "for", "Ext", "Direct", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/controller/ApiController.java#L93-L143
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java
ExtDirectFormPostResult.addError
public void addError(String field, String error) { Assert.notNull(field, "field must not be null"); Assert.notNull(error, "field must not be null"); addErrors(field, Collections.singletonList(error)); addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE); }
java
public void addError(String field, String error) { Assert.notNull(field, "field must not be null"); Assert.notNull(error, "field must not be null"); addErrors(field, Collections.singletonList(error)); addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE); }
[ "public", "void", "addError", "(", "String", "field", ",", "String", "error", ")", "{", "Assert", ".", "notNull", "(", "field", ",", "\"field must not be null\"", ")", ";", "Assert", ".", "notNull", "(", "error", ",", "\"field must not be null\"", ")", ";", ...
Adds one error message to a specific field. Does not overwrite already existing errors. @param field the name of the field @param error the error message
[ "Adds", "one", "error", "message", "to", "a", "specific", "field", ".", "Does", "not", "overwrite", "already", "existing", "errors", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java#L181-L188
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java
ExtDirectFormPostResult.addErrors
@SuppressWarnings("unchecked") public void addErrors(String field, List<String> errors) { Assert.notNull(field, "field must not be null"); Assert.notNull(errors, "field must not be null"); // do not overwrite existing errors Map<String, List<String>> errorMap = (Map<String, List<String>>) this.result .get...
java
@SuppressWarnings("unchecked") public void addErrors(String field, List<String> errors) { Assert.notNull(field, "field must not be null"); Assert.notNull(errors, "field must not be null"); // do not overwrite existing errors Map<String, List<String>> errorMap = (Map<String, List<String>>) this.result .get...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "addErrors", "(", "String", "field", ",", "List", "<", "String", ">", "errors", ")", "{", "Assert", ".", "notNull", "(", "field", ",", "\"field must not be null\"", ")", ";", "Assert", "."...
Adds multiple error messages to a specific field. Does not overwrite already existing errors. @param field the name of the field @param errors a collection of error messages
[ "Adds", "multiple", "error", "messages", "to", "a", "specific", "field", ".", "Does", "not", "overwrite", "already", "existing", "errors", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java#L197-L218
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectStoreReadRequest.java
ExtDirectStoreReadRequest.getFirstFilterForField
@SuppressWarnings("unchecked") public <T extends Filter> T getFirstFilterForField(String field) { for (Filter filter : this.filters) { if (filter.getField().equals(field)) { return (T) filter; } } return null; }
java
@SuppressWarnings("unchecked") public <T extends Filter> T getFirstFilterForField(String field) { for (Filter filter : this.filters) { if (filter.getField().equals(field)) { return (T) filter; } } return null; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", "extends", "Filter", ">", "T", "getFirstFilterForField", "(", "String", "field", ")", "{", "for", "(", "Filter", "filter", ":", "this", ".", "filters", ")", "{", "if", "(", "filter", ...
Returns the first filter for the field. @param field name of the field @return the first filter for the field. Null if not filter exists.
[ "Returns", "the", "first", "filter", "for", "the", "field", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectStoreReadRequest.java#L214-L222
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectStoreReadRequest.java
ExtDirectStoreReadRequest.getAllFiltersForField
public List<Filter> getAllFiltersForField(String field) { List<Filter> foundFilters = new ArrayList<>(); for (Filter filter : this.filters) { if (filter.getField().equals(field)) { foundFilters.add(filter); } } return Collections.unmodifiableList(foundFilters); }
java
public List<Filter> getAllFiltersForField(String field) { List<Filter> foundFilters = new ArrayList<>(); for (Filter filter : this.filters) { if (filter.getField().equals(field)) { foundFilters.add(filter); } } return Collections.unmodifiableList(foundFilters); }
[ "public", "List", "<", "Filter", ">", "getAllFiltersForField", "(", "String", "field", ")", "{", "List", "<", "Filter", ">", "foundFilters", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Filter", "filter", ":", "this", ".", "filters", ")", ...
Returns all filters for a field @param field name of the field @return a collection of filters for the field. Empty collection if no filter exists
[ "Returns", "all", "filters", "for", "a", "field" ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectStoreReadRequest.java#L230-L240
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectResponseBuilder.java
ExtDirectResponseBuilder.addResultProperty
public ExtDirectResponseBuilder addResultProperty(String key, Object value) { this.result.put(key, value); return this; }
java
public ExtDirectResponseBuilder addResultProperty(String key, Object value) { this.result.put(key, value); return this; }
[ "public", "ExtDirectResponseBuilder", "addResultProperty", "(", "String", "key", ",", "Object", "value", ")", "{", "this", ".", "result", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Add additional property to the response. @param key the key of the property @param value the value of this property @return this instance
[ "Add", "additional", "property", "to", "the", "response", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectResponseBuilder.java#L188-L191
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java
ExtDirectSpringUtil.isMultipart
public static boolean isMultipart(HttpServletRequest request) { if (!"post".equals(request.getMethod().toLowerCase())) { return false; } String contentType = request.getContentType(); return contentType != null && contentType.toLowerCase().startsWith("multipart/"); }
java
public static boolean isMultipart(HttpServletRequest request) { if (!"post".equals(request.getMethod().toLowerCase())) { return false; } String contentType = request.getContentType(); return contentType != null && contentType.toLowerCase().startsWith("multipart/"); }
[ "public", "static", "boolean", "isMultipart", "(", "HttpServletRequest", "request", ")", "{", "if", "(", "!", "\"post\"", ".", "equals", "(", "request", ".", "getMethod", "(", ")", ".", "toLowerCase", "(", ")", ")", ")", "{", "return", "false", ";", "}",...
Checks if the request is a multipart request @param request the HTTP servlet request @return true if request is a Multipart request (file upload)
[ "Checks", "if", "the", "request", "is", "a", "multipart", "request" ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java#L74-L80
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java
ExtDirectSpringUtil.invoke
public static Object invoke(ApplicationContext context, String beanName, MethodInfo methodInfo, final Object[] params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { Object bean = context.getBean(beanName); Method handlerMethod = methodInfo.getMethod(); ReflectionUtils...
java
public static Object invoke(ApplicationContext context, String beanName, MethodInfo methodInfo, final Object[] params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { Object bean = context.getBean(beanName); Method handlerMethod = methodInfo.getMethod(); ReflectionUtils...
[ "public", "static", "Object", "invoke", "(", "ApplicationContext", "context", ",", "String", "beanName", ",", "MethodInfo", "methodInfo", ",", "final", "Object", "[", "]", "params", ")", "throws", "IllegalArgumentException", ",", "IllegalAccessException", ",", "Invo...
Invokes a method on a Spring managed bean. @param context a Spring application context @param beanName the name of the bean @param methodInfo the methodInfo object @param params the parameters @return the result of the method invocation @throws IllegalArgumentException if there is no bean in the context @throws Illega...
[ "Invokes", "a", "method", "on", "a", "Spring", "managed", "bean", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java#L94-L108
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java
ExtDirectSpringUtil.addCacheHeaders
public static void addCacheHeaders(HttpServletResponse response, String etag, Integer month) { Assert.notNull(etag, "ETag must not be null"); long seconds; if (month != null) { seconds = month * secondsInAMonth; } else { seconds = 6L * secondsInAMonth; } response.setDateHeader("Expires", System...
java
public static void addCacheHeaders(HttpServletResponse response, String etag, Integer month) { Assert.notNull(etag, "ETag must not be null"); long seconds; if (month != null) { seconds = month * secondsInAMonth; } else { seconds = 6L * secondsInAMonth; } response.setDateHeader("Expires", System...
[ "public", "static", "void", "addCacheHeaders", "(", "HttpServletResponse", "response", ",", "String", "etag", ",", "Integer", "month", ")", "{", "Assert", ".", "notNull", "(", "etag", ",", "\"ETag must not be null\"", ")", ";", "long", "seconds", ";", "if", "(...
Adds Expires, ETag and Cache-Control response headers. @param response the HTTP servlet response @param etag the calculated etag (md5) of the response @param month number of months the response can be cached. Added to the Expires and Cache-Control header. If null defaults to 6 months.
[ "Adds", "Expires", "ETag", "and", "Cache", "-", "Control", "response", "headers", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java#L147-L162
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java
ExtDirectSpringUtil.generateApiString
public static String generateApiString(ApplicationContext ctx, String remotingVarName, String pollingApiVarName) throws JsonProcessingException { RemotingApi remotingApi = new RemotingApi(ctx.getBean(ConfigurationService.class) .getConfiguration().getProviderType(), "router", null); for (Map.Entry<MethodInf...
java
public static String generateApiString(ApplicationContext ctx, String remotingVarName, String pollingApiVarName) throws JsonProcessingException { RemotingApi remotingApi = new RemotingApi(ctx.getBean(ConfigurationService.class) .getConfiguration().getProviderType(), "router", null); for (Map.Entry<MethodInf...
[ "public", "static", "String", "generateApiString", "(", "ApplicationContext", "ctx", ",", "String", "remotingVarName", ",", "String", "pollingApiVarName", ")", "throws", "JsonProcessingException", "{", "RemotingApi", "remotingApi", "=", "new", "RemotingApi", "(", "ctx",...
Returns the api configuration as a String @param ctx The spring applicationcontext @param remotingVarName name of the variable for the remoting configuration (e.g. REMOTING_API) @param pollingApiVarName name of the variable for the polling configuration (e.g. POLLING_URLS) @return the api configuration @throws JsonProc...
[ "Returns", "the", "api", "configuration", "as", "a", "String" ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/ExtDirectSpringUtil.java#L221-L269
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/JsonHandler.java
JsonHandler.writeValueAsString
public String writeValueAsString(Object obj, boolean indent) { try { if (indent) { return this.mapper.writer().withDefaultPrettyPrinter() .writeValueAsString(obj); } return this.mapper.writeValueAsString(obj); } catch (Exception e) { LogFactory.getLog(JsonHandler.class).info("serialize objec...
java
public String writeValueAsString(Object obj, boolean indent) { try { if (indent) { return this.mapper.writer().withDefaultPrettyPrinter() .writeValueAsString(obj); } return this.mapper.writeValueAsString(obj); } catch (Exception e) { LogFactory.getLog(JsonHandler.class).info("serialize objec...
[ "public", "String", "writeValueAsString", "(", "Object", "obj", ",", "boolean", "indent", ")", "{", "try", "{", "if", "(", "indent", ")", "{", "return", "this", ".", "mapper", ".", "writer", "(", ")", ".", "withDefaultPrettyPrinter", "(", ")", ".", "writ...
Converts an object into a JSON string. In case of an exceptions returns null and logs the exception. @param obj the source object @param indent if true JSON is written in a human readable format, if false JSON is written on one line @return obj JSON string, <code>null</code> if an exception occurred
[ "Converts", "an", "object", "into", "a", "JSON", "string", ".", "In", "case", "of", "an", "exceptions", "returns", "null", "and", "logs", "the", "exception", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/JsonHandler.java#L80-L92
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/JsonHandler.java
JsonHandler.readValue
public Object readValue(InputStream is, Class<Object> clazz) { try { return this.mapper.readValue(is, clazz); } catch (Exception e) { LogFactory.getLog(JsonHandler.class).info("deserialize json to object", e); return null; } }
java
public Object readValue(InputStream is, Class<Object> clazz) { try { return this.mapper.readValue(is, clazz); } catch (Exception e) { LogFactory.getLog(JsonHandler.class).info("deserialize json to object", e); return null; } }
[ "public", "Object", "readValue", "(", "InputStream", "is", ",", "Class", "<", "Object", ">", "clazz", ")", "{", "try", "{", "return", "this", ".", "mapper", ".", "readValue", "(", "is", ",", "clazz", ")", ";", "}", "catch", "(", "Exception", "e", ")"...
Converts a JSON string into an object. The input is read from an InputStream. In case of an exception returns null and logs the exception. @param is a InputStream @param clazz class of object to create @return the converted object, null if there is an exception
[ "Converts", "a", "JSON", "string", "into", "an", "object", ".", "The", "input", "is", "read", "from", "an", "InputStream", ".", "In", "case", "of", "an", "exception", "returns", "null", "and", "logs", "the", "exception", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/JsonHandler.java#L142-L150
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/MethodInfo.java
MethodInfo.findMethodWithAnnotation
public static Method findMethodWithAnnotation(Method method, Class<? extends Annotation> annotation) { if (method.isAnnotationPresent(annotation)) { return method; } Class<?> cl = method.getDeclaringClass(); while (cl != null && cl != Object.class) { try { Method equivalentMethod = cl.getDeclaredM...
java
public static Method findMethodWithAnnotation(Method method, Class<? extends Annotation> annotation) { if (method.isAnnotationPresent(annotation)) { return method; } Class<?> cl = method.getDeclaringClass(); while (cl != null && cl != Object.class) { try { Method equivalentMethod = cl.getDeclaredM...
[ "public", "static", "Method", "findMethodWithAnnotation", "(", "Method", "method", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotation", ")", "{", "if", "(", "method", ".", "isAnnotationPresent", "(", "annotation", ")", ")", "{", "return", "metho...
Find a method that is annotated with a specific annotation. Starts with the method and goes up to the superclasses of the class. @param method the starting method @param annotation the annotation to look for @return the method if there is a annotated method, else null
[ "Find", "a", "method", "that", "is", "annotated", "with", "a", "specific", "annotation", ".", "Starts", "with", "the", "method", "and", "goes", "up", "to", "the", "superclasses", "of", "the", "class", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/MethodInfo.java#L356-L378
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/MethodInfoCache.java
MethodInfoCache.put
public void put(String beanName, Class<?> clazz, Method method, ApplicationContext context) { MethodInfo info = new MethodInfo(clazz, context, beanName, method); this.cache.put(new Key(beanName, method.getName()), info); }
java
public void put(String beanName, Class<?> clazz, Method method, ApplicationContext context) { MethodInfo info = new MethodInfo(clazz, context, beanName, method); this.cache.put(new Key(beanName, method.getName()), info); }
[ "public", "void", "put", "(", "String", "beanName", ",", "Class", "<", "?", ">", "clazz", ",", "Method", "method", ",", "ApplicationContext", "context", ")", "{", "MethodInfo", "info", "=", "new", "MethodInfo", "(", "clazz", ",", "context", ",", "beanName"...
Put a method into the MethodCache. @param beanName the name of the bean @param clazz the class of the bean @param method the method @param context the Spring application context
[ "Put", "a", "method", "into", "the", "MethodCache", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/MethodInfoCache.java#L49-L53
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/util/MethodInfoCache.java
MethodInfoCache.get
public MethodInfo get(String beanName, String methodName) { return this.cache.get(new Key(beanName, methodName)); }
java
public MethodInfo get(String beanName, String methodName) { return this.cache.get(new Key(beanName, methodName)); }
[ "public", "MethodInfo", "get", "(", "String", "beanName", ",", "String", "methodName", ")", "{", "return", "this", ".", "cache", ".", "get", "(", "new", "Key", "(", "beanName", ",", "methodName", ")", ")", ";", "}" ]
Get a method from the MethodCache. @param beanName the name of the bean @param methodName the name of the method @return the found methodInfo object, null if there is no method found in the cache
[ "Get", "a", "method", "from", "the", "MethodCache", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/MethodInfoCache.java#L62-L64
train
ralscha/extdirectspring
src/main/java/ch/ralscha/extdirectspring/controller/Configuration.java
Configuration.getMessage
public String getMessage(Throwable exception) { String message; if (getExceptionToMessage() != null) { message = getExceptionToMessage().get(exception.getClass()); if (StringUtils.hasText(message)) { return message; } // map entry with a null value if (getExceptionToMessage().containsKey(excepti...
java
public String getMessage(Throwable exception) { String message; if (getExceptionToMessage() != null) { message = getExceptionToMessage().get(exception.getClass()); if (StringUtils.hasText(message)) { return message; } // map entry with a null value if (getExceptionToMessage().containsKey(excepti...
[ "public", "String", "getMessage", "(", "Throwable", "exception", ")", "{", "String", "message", ";", "if", "(", "getExceptionToMessage", "(", ")", "!=", "null", ")", "{", "message", "=", "getExceptionToMessage", "(", ")", ".", "get", "(", "exception", ".", ...
Returns an error message for the supplied exception and based on this configuration. @see #setDefaultExceptionMessage(String) @see #setSendExceptionMessage(boolean) @see #setExceptionToMessage(Map) @param exception the thrown exception @return exception message
[ "Returns", "an", "error", "message", "for", "the", "supplied", "exception", "and", "based", "on", "this", "configuration", "." ]
4b018497c4e7503033f91d0491b4e74bf8291d2c
https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/controller/Configuration.java#L303-L322
train
sargue/mailgun
src/main/java/net/sargue/mailgun/Configuration.java
Configuration.copy
@Deprecated public Configuration copy() { Configuration copy = new Configuration(); copy.apiUrl = apiUrl; copy.domain = domain; copy.apiKey = apiKey; copy.mailRequestCallbackFactory = mailRequestCallbackFactory; copy.mailSendFilter = mailSendFilter; //noinspec...
java
@Deprecated public Configuration copy() { Configuration copy = new Configuration(); copy.apiUrl = apiUrl; copy.domain = domain; copy.apiKey = apiKey; copy.mailRequestCallbackFactory = mailRequestCallbackFactory; copy.mailSendFilter = mailSendFilter; //noinspec...
[ "@", "Deprecated", "public", "Configuration", "copy", "(", ")", "{", "Configuration", "copy", "=", "new", "Configuration", "(", ")", ";", "copy", ".", "apiUrl", "=", "apiUrl", ";", "copy", ".", "domain", "=", "domain", ";", "copy", ".", "apiKey", "=", ...
Creates a copy of this configuration. @return a copy of this configuration @deprecated it's not clear what a 'copy' is so this method will be removed
[ "Creates", "a", "copy", "of", "this", "configuration", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/Configuration.java#L87-L99
train
sargue/mailgun
src/main/java/net/sargue/mailgun/MailBuilder.java
MailBuilder.from
public MailBuilder from(String name, String email) { return param("from", email(name, email)); }
java
public MailBuilder from(String name, String email) { return param("from", email(name, email)); }
[ "public", "MailBuilder", "from", "(", "String", "name", ",", "String", "email", ")", "{", "return", "param", "(", "\"from\"", ",", "email", "(", "name", ",", "email", ")", ")", ";", "}" ]
Sets the address of the sender. @param name the name of the sender @param email the address of the sender @return this builder
[ "Sets", "the", "address", "of", "the", "sender", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MailBuilder.java#L82-L84
train
sargue/mailgun
src/main/java/net/sargue/mailgun/MailBuilder.java
MailBuilder.to
public MailBuilder to(String name, String email) { return param("to", email(name, email)); }
java
public MailBuilder to(String name, String email) { return param("to", email(name, email)); }
[ "public", "MailBuilder", "to", "(", "String", "name", ",", "String", "email", ")", "{", "return", "param", "(", "\"to\"", ",", "email", "(", "name", ",", "email", ")", ")", ";", "}" ]
Adds a destination recipient's address. @param name the name of the destination recipient @param email the address of the destination recipient @return this builder
[ "Adds", "a", "destination", "recipient", "s", "address", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MailBuilder.java#L108-L110
train
sargue/mailgun
src/main/java/net/sargue/mailgun/MailBuilder.java
MailBuilder.cc
public MailBuilder cc(String name, String email) { return param("cc", email(name, email)); }
java
public MailBuilder cc(String name, String email) { return param("cc", email(name, email)); }
[ "public", "MailBuilder", "cc", "(", "String", "name", ",", "String", "email", ")", "{", "return", "param", "(", "\"cc\"", ",", "email", "(", "name", ",", "email", ")", ")", ";", "}" ]
Adds a CC recipient's address. @param name the name of the CC recipient @param email the address of the CC recipient @return this builder
[ "Adds", "a", "CC", "recipient", "s", "address", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MailBuilder.java#L134-L136
train
sargue/mailgun
src/main/java/net/sargue/mailgun/MailBuilder.java
MailBuilder.bcc
public MailBuilder bcc(String name, String email) { return param("bcc", email(name, email)); }
java
public MailBuilder bcc(String name, String email) { return param("bcc", email(name, email)); }
[ "public", "MailBuilder", "bcc", "(", "String", "name", ",", "String", "email", ")", "{", "return", "param", "(", "\"bcc\"", ",", "email", "(", "name", ",", "email", ")", ")", ";", "}" ]
Adds a BCC recipient's address. @param name the name of the BCC recipient @param email the address of the BCC recipient @return this builder
[ "Adds", "a", "BCC", "recipient", "s", "address", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MailBuilder.java#L160-L162
train
sargue/mailgun
src/main/java/net/sargue/mailgun/Mail.java
Mail.sendAsync
public void sendAsync() { if (!configuration.mailSendFilter().filter(this)) return; MailRequestCallbackFactory factory = configuration.mailRequestCallbackFactory(); if (factory == null) { prepareSend(); request().async().post(entity()); } else sendAsyn...
java
public void sendAsync() { if (!configuration.mailSendFilter().filter(this)) return; MailRequestCallbackFactory factory = configuration.mailRequestCallbackFactory(); if (factory == null) { prepareSend(); request().async().post(entity()); } else sendAsyn...
[ "public", "void", "sendAsync", "(", ")", "{", "if", "(", "!", "configuration", ".", "mailSendFilter", "(", ")", ".", "filter", "(", "this", ")", ")", "return", ";", "MailRequestCallbackFactory", "factory", "=", "configuration", ".", "mailRequestCallbackFactory",...
Sends the email asynchronously. It uses the configuration provided default callback if available, ignoring the outcome otherwise. If you want to use a specific callback for this call use {@link #sendAsync(MailRequestCallback)} instead.
[ "Sends", "the", "email", "asynchronously", ".", "It", "uses", "the", "configuration", "provided", "default", "callback", "if", "available", "ignoring", "the", "outcome", "otherwise", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/Mail.java#L116-L124
train
sargue/mailgun
src/main/java/net/sargue/mailgun/MultipartBuilder.java
MultipartBuilder.attachment
public MultipartBuilder attachment(InputStream is, String filename) { return bodyPart(new StreamDataBodyPart(ATTACHMENT_NAME, is, filename)); }
java
public MultipartBuilder attachment(InputStream is, String filename) { return bodyPart(new StreamDataBodyPart(ATTACHMENT_NAME, is, filename)); }
[ "public", "MultipartBuilder", "attachment", "(", "InputStream", "is", ",", "String", "filename", ")", "{", "return", "bodyPart", "(", "new", "StreamDataBodyPart", "(", "ATTACHMENT_NAME", ",", "is", ",", "filename", ")", ")", ";", "}" ]
Adds a named attachment. @param is an stream to read the attachment @param filename the filename to give to the attachment @return this builder
[ "Adds", "a", "named", "attachment", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MultipartBuilder.java#L66-L68
train
sargue/mailgun
src/main/java/net/sargue/mailgun/MultipartBuilder.java
MultipartBuilder.attachment
public MultipartBuilder attachment(String content, String filename) { ByteArrayInputStream is = new ByteArrayInputStream(content.getBytes()); return bodyPart(new StreamDataBodyPart(ATTACHMENT_NAME, is, filename)); }
java
public MultipartBuilder attachment(String content, String filename) { ByteArrayInputStream is = new ByteArrayInputStream(content.getBytes()); return bodyPart(new StreamDataBodyPart(ATTACHMENT_NAME, is, filename)); }
[ "public", "MultipartBuilder", "attachment", "(", "String", "content", ",", "String", "filename", ")", "{", "ByteArrayInputStream", "is", "=", "new", "ByteArrayInputStream", "(", "content", ".", "getBytes", "(", ")", ")", ";", "return", "bodyPart", "(", "new", ...
Adds an attachment directly by content. @param content the content of the attachment @param filename the filename of the attachment @return this builder
[ "Adds", "an", "attachment", "directly", "by", "content", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MultipartBuilder.java#L91-L94
train
sargue/mailgun
src/main/java/net/sargue/mailgun/MultipartBuilder.java
MultipartBuilder.inline
public MultipartBuilder inline(InputStream is, String cidName) { return bodyPart(new StreamDataBodyPart("inline", is, cidName)); }
java
public MultipartBuilder inline(InputStream is, String cidName) { return bodyPart(new StreamDataBodyPart("inline", is, cidName)); }
[ "public", "MultipartBuilder", "inline", "(", "InputStream", "is", ",", "String", "cidName", ")", "{", "return", "bodyPart", "(", "new", "StreamDataBodyPart", "(", "\"inline\"", ",", "is", ",", "cidName", ")", ")", ";", "}" ]
Adds a named inline attachment. @param is an stream to read the attachment @param cidName the name to give to the attachment as referenced by the HTML email body i.e. use cidName sample-image.png for the below example <p> <img src="cid:sample-image.png" alt="sample"> </p> @return this builder
[ "Adds", "a", "named", "inline", "attachment", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MultipartBuilder.java#L107-L109
train
sargue/mailgun
src/main/java/net/sargue/mailgun/content/MailContent.java
MailContent.row
public MailContent row(String firstCell, String secondCell, String thirdCell) { return tag("tr").cell(firstCell).cell(secondCell).cell(thirdCell).end(); }
java
public MailContent row(String firstCell, String secondCell, String thirdCell) { return tag("tr").cell(firstCell).cell(secondCell).cell(thirdCell).end(); }
[ "public", "MailContent", "row", "(", "String", "firstCell", ",", "String", "secondCell", ",", "String", "thirdCell", ")", "{", "return", "tag", "(", "\"tr\"", ")", ".", "cell", "(", "firstCell", ")", ".", "cell", "(", "secondCell", ")", ".", "cell", "(",...
Adds a new row with three columns. @param firstCell the first cell text content @param secondCell the second cell text content @param thirdCell the third cell text content @return the changed mail content object
[ "Adds", "a", "new", "row", "with", "three", "columns", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/content/MailContent.java#L403-L407
train
sargue/mailgun
src/main/java/net/sargue/mailgun/content/Builder.java
Builder.mail
public MailBuilder mail() { if (mailBuilder != null) return mailBuilder.content(build()); else return MailBuilder.using(configuration).content(build()); }
java
public MailBuilder mail() { if (mailBuilder != null) return mailBuilder.content(build()); else return MailBuilder.using(configuration).content(build()); }
[ "public", "MailBuilder", "mail", "(", ")", "{", "if", "(", "mailBuilder", "!=", "null", ")", "return", "mailBuilder", ".", "content", "(", "build", "(", ")", ")", ";", "else", "return", "MailBuilder", ".", "using", "(", "configuration", ")", ".", "conten...
Convenience method for chaining the creation of the content body with the creation of the mail envelope. If this builder was created associated to a MailBuilder, that one (with the content updated) is returned. Else it returns a new {@link MailBuilder} with this content and using the same * configuration that this Bu...
[ "Convenience", "method", "for", "chaining", "the", "creation", "of", "the", "content", "body", "with", "the", "creation", "of", "the", "mail", "envelope", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/content/Builder.java#L96-L101
train
sargue/mailgun
src/main/java/net/sargue/mailgun/content/Builder.java
Builder.end
public Builder end() { if (ends.isEmpty()) throw new IllegalStateException("No pending tag/section to close."); String tag = ends.pop(); html.a(tag); if (newLineAfterTheseTags.contains(tag.toLowerCase())) { html.nl(); text.nl(); } retur...
java
public Builder end() { if (ends.isEmpty()) throw new IllegalStateException("No pending tag/section to close."); String tag = ends.pop(); html.a(tag); if (newLineAfterTheseTags.contains(tag.toLowerCase())) { html.nl(); text.nl(); } retur...
[ "public", "Builder", "end", "(", ")", "{", "if", "(", "ends", ".", "isEmpty", "(", ")", ")", "throw", "new", "IllegalStateException", "(", "\"No pending tag/section to close.\"", ")", ";", "String", "tag", "=", "ends", ".", "pop", "(", ")", ";", "html", ...
Closes the last opened tag or section. @return this builder @throws IllegalStateException if there are no pending tags to close
[ "Closes", "the", "last", "opened", "tag", "or", "section", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/content/Builder.java#L109-L119
train
sargue/mailgun
src/main/java/net/sargue/mailgun/content/Builder.java
Builder.row
public <T> Builder row(T firstCell, T secondCell) { return tag("tr").cell(firstCell, false).cell(secondCell).end(); }
java
public <T> Builder row(T firstCell, T secondCell) { return tag("tr").cell(firstCell, false).cell(secondCell).end(); }
[ "public", "<", "T", ">", "Builder", "row", "(", "T", "firstCell", ",", "T", "secondCell", ")", "{", "return", "tag", "(", "\"tr\"", ")", ".", "cell", "(", "firstCell", ",", "false", ")", ".", "cell", "(", "secondCell", ")", ".", "end", "(", ")", ...
Adds a new row with two columns. @param <T> the type parameter @param firstCell the first cell content @param secondCell the second cell content @return this builder
[ "Adds", "a", "new", "row", "with", "two", "columns", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/content/Builder.java#L440-L442
train
sargue/mailgun
src/main/java/net/sargue/mailgun/content/Builder.java
Builder.rowh
public <T> Builder rowh(String label, T data) { return tag("tr").cellHeader(label, false).cell(data).end(); }
java
public <T> Builder rowh(String label, T data) { return tag("tr").cellHeader(label, false).cell(data).end(); }
[ "public", "<", "T", ">", "Builder", "rowh", "(", "String", "label", ",", "T", "data", ")", "{", "return", "tag", "(", "\"tr\"", ")", ".", "cellHeader", "(", "label", ",", "false", ")", ".", "cell", "(", "data", ")", ".", "end", "(", ")", ";", "...
Adds a new row with two columns, the first one being a header cell. @param <T> the type parameter @param label the header cell content @param data the second cell content @return this builder
[ "Adds", "a", "new", "row", "with", "two", "columns", "the", "first", "one", "being", "a", "header", "cell", "." ]
2ffb0a156f3f3666eb1bb2db661451b9377c3d11
https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/content/Builder.java#L452-L454
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/ArrayUtil.java
ArrayUtil.flatten
public static Object flatten(Object array) { Preconditions.checkArgument(array.getClass().isArray(), "array"); Class<?> type = getType(array); int[] dimensions = getDimensions(array); int length = length(dimensions); Object flattened = Array.newInstance(type, length); ...
java
public static Object flatten(Object array) { Preconditions.checkArgument(array.getClass().isArray(), "array"); Class<?> type = getType(array); int[] dimensions = getDimensions(array); int length = length(dimensions); Object flattened = Array.newInstance(type, length); ...
[ "public", "static", "Object", "flatten", "(", "Object", "array", ")", "{", "Preconditions", ".", "checkArgument", "(", "array", ".", "getClass", "(", ")", ".", "isArray", "(", ")", ",", "\"array\"", ")", ";", "Class", "<", "?", ">", "type", "=", "getTy...
Flatten a multi-dimensional array into a one-dimensional array. @param array the array to flatten. @return a 1-dimensional array.
[ "Flatten", "a", "multi", "-", "dimensional", "array", "into", "a", "one", "-", "dimensional", "array", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/ArrayUtil.java#L33-L45
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/ArrayUtil.java
ArrayUtil.unflatten
public static Object unflatten(Object array, int[] dimensions) { Class<?> type = getType(array); return unflatten(type, array, dimensions, 0); }
java
public static Object unflatten(Object array, int[] dimensions) { Class<?> type = getType(array); return unflatten(type, array, dimensions, 0); }
[ "public", "static", "Object", "unflatten", "(", "Object", "array", ",", "int", "[", "]", "dimensions", ")", "{", "Class", "<", "?", ">", "type", "=", "getType", "(", "array", ")", ";", "return", "unflatten", "(", "type", ",", "array", ",", "dimensions"...
Un-flatten a one-dimensional array into an multi-dimensional array based on the provided dimensions. @param array the 1-dimensional array to un-flatten. @param dimensions the dimensions to un-flatten to. @return a multi-dimensional array of the provided dimensions.
[ "Un", "-", "flatten", "a", "one", "-", "dimensional", "array", "into", "an", "multi", "-", "dimensional", "array", "based", "on", "the", "provided", "dimensions", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/ArrayUtil.java#L70-L74
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/DigestUtil.java
DigestUtil.sha1
public static byte[] sha1(byte[] input) { MessageDigest messageDigest = sha1Digest.get(); if (messageDigest == null) { try { messageDigest = MessageDigest.getInstance("SHA1"); sha1Digest.set(messageDigest); } catch (NoSuchAlgorithmException e) { ...
java
public static byte[] sha1(byte[] input) { MessageDigest messageDigest = sha1Digest.get(); if (messageDigest == null) { try { messageDigest = MessageDigest.getInstance("SHA1"); sha1Digest.set(messageDigest); } catch (NoSuchAlgorithmException e) { ...
[ "public", "static", "byte", "[", "]", "sha1", "(", "byte", "[", "]", "input", ")", "{", "MessageDigest", "messageDigest", "=", "sha1Digest", ".", "get", "(", ")", ";", "if", "(", "messageDigest", "==", "null", ")", "{", "try", "{", "messageDigest", "="...
Compute the SHA1 digest for a given input. @param input the input to compute the digest for. @return the SHA1 digest of {@code input}.
[ "Compute", "the", "SHA1", "digest", "for", "a", "given", "input", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/DigestUtil.java#L35-L48
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/channel/messages/TcpMessageEncoder.java
TcpMessageEncoder.encode
private static ByteBuf encode(MessageType messageType, Consumer<ByteBuf> messageEncoder, ByteBuf buffer) throws UaException { buffer.writeMedium(MessageType.toMediumInt(messageType)); buffer.writeByte('F'); int lengthIndex = buffer.writerIndex(); buffer.writeInt(0); int indexBe...
java
private static ByteBuf encode(MessageType messageType, Consumer<ByteBuf> messageEncoder, ByteBuf buffer) throws UaException { buffer.writeMedium(MessageType.toMediumInt(messageType)); buffer.writeByte('F'); int lengthIndex = buffer.writerIndex(); buffer.writeInt(0); int indexBe...
[ "private", "static", "ByteBuf", "encode", "(", "MessageType", "messageType", ",", "Consumer", "<", "ByteBuf", ">", "messageEncoder", ",", "ByteBuf", "buffer", ")", "throws", "UaException", "{", "buffer", ".", "writeMedium", "(", "MessageType", ".", "toMediumInt", ...
Encode a simple UA TCP message. @param messageType {@link MessageType#Hello}, {@link MessageType#Acknowledge}, or {@link MessageType#Error}. @param messageEncoder a function that encodes the message payload. @param buffer the {@link ByteBuf} to encode into.
[ "Encode", "a", "simple", "UA", "TCP", "message", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/channel/messages/TcpMessageEncoder.java#L59-L76
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java
CertificateValidationUtil.validateHostnameOrIpAddress
public static void validateHostnameOrIpAddress(X509Certificate certificate, String hostname) throws UaException { boolean dnsNameMatches = validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_DNS_NAME, hostname::equals); boolean ipAddressMatches = validateSubjectAlt...
java
public static void validateHostnameOrIpAddress(X509Certificate certificate, String hostname) throws UaException { boolean dnsNameMatches = validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_DNS_NAME, hostname::equals); boolean ipAddressMatches = validateSubjectAlt...
[ "public", "static", "void", "validateHostnameOrIpAddress", "(", "X509Certificate", "certificate", ",", "String", "hostname", ")", "throws", "UaException", "{", "boolean", "dnsNameMatches", "=", "validateSubjectAltNameField", "(", "certificate", ",", "SUBJECT_ALT_NAME_DNS_NA...
Validate that the hostname used in the endpoint URL matches either the SubjectAltName DNSName or IPAddress in the given certificate. @param certificate the certificate to validate against. @param hostname the hostname used in the endpoint URL. @throws UaException if there is no matching DNSName or IPAddress entry.
[ "Validate", "that", "the", "hostname", "used", "in", "the", "endpoint", "URL", "matches", "either", "the", "SubjectAltName", "DNSName", "or", "IPAddress", "in", "the", "given", "certificate", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java#L111-L121
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java
CertificateValidationUtil.validateApplicationUri
public static void validateApplicationUri(X509Certificate certificate, String applicationUri) throws UaException { if (!validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_URI, applicationUri::equals)) { throw new UaException(StatusCodes.Bad_CertificateUriInvalid); } }
java
public static void validateApplicationUri(X509Certificate certificate, String applicationUri) throws UaException { if (!validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_URI, applicationUri::equals)) { throw new UaException(StatusCodes.Bad_CertificateUriInvalid); } }
[ "public", "static", "void", "validateApplicationUri", "(", "X509Certificate", "certificate", ",", "String", "applicationUri", ")", "throws", "UaException", "{", "if", "(", "!", "validateSubjectAltNameField", "(", "certificate", ",", "SUBJECT_ALT_NAME_URI", ",", "applica...
Validate that the application URI matches the SubjectAltName URI in the given certificate. @param certificate the certificate to validate against. @param applicationUri the URI to validate. @throws UaException if the certificate is invalid, does not contain a uri, or contains a uri that does not match.
[ "Validate", "that", "the", "application", "URI", "matches", "the", "SubjectAltName", "URI", "in", "the", "given", "certificate", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java#L130-L134
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/SignatureUtil.java
SignatureUtil.hmac
public static byte[] hmac(SecurityAlgorithm securityAlgorithm, byte[] secretKey, ByteBuffer... buffers) throws UaException { String transformation = securityAlgorithm.getTransformation(); try { Mac mac = Mac.getInstance(transforma...
java
public static byte[] hmac(SecurityAlgorithm securityAlgorithm, byte[] secretKey, ByteBuffer... buffers) throws UaException { String transformation = securityAlgorithm.getTransformation(); try { Mac mac = Mac.getInstance(transforma...
[ "public", "static", "byte", "[", "]", "hmac", "(", "SecurityAlgorithm", "securityAlgorithm", ",", "byte", "[", "]", "secretKey", ",", "ByteBuffer", "...", "buffers", ")", "throws", "UaException", "{", "String", "transformation", "=", "securityAlgorithm", ".", "g...
Compute the HMAC of the provided buffers. @param securityAlgorithm the {@link SecurityAlgorithm} that provides the transformation for {@link Mac#getInstance(String)}}. @param secretKey the secret key. @param buffers the buffers to use. @return the computed HMAC. @throws UaException
[ "Compute", "the", "HMAC", "of", "the", "provided", "buffers", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/SignatureUtil.java#L72-L90
train
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/StatusCodes.java
StatusCodes.lookup
public static Optional<String[]> lookup(long code) { String[] desc = DESCRIPTIONS.get(code & 0xFFFF0000); return Optional.ofNullable(desc); }
java
public static Optional<String[]> lookup(long code) { String[] desc = DESCRIPTIONS.get(code & 0xFFFF0000); return Optional.ofNullable(desc); }
[ "public", "static", "Optional", "<", "String", "[", "]", ">", "lookup", "(", "long", "code", ")", "{", "String", "[", "]", "desc", "=", "DESCRIPTIONS", ".", "get", "(", "code", "&", "0xFFFF0000", ")", ";", "return", "Optional", ".", "ofNullable", "(", ...
Lookup information about a StatusCode. @param code the code to lookup. @return a String[] where String[0] contains the name and String[1] contains the description.
[ "Lookup", "information", "about", "a", "StatusCode", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/StatusCodes.java#L61-L65
train
kevinherron/opc-ua-stack
stack-client/src/main/java/com/digitalpetri/opcua/stack/client/UaTcpStackClient.java
UaTcpStackClient.getEndpoints
public static CompletableFuture<EndpointDescription[]> getEndpoints(String endpointUrl) { UaTcpStackClientConfig config = UaTcpStackClientConfig.builder() .setEndpointUrl(endpointUrl) .build(); UaTcpStackClient client = new UaTcpStackClient(config); GetEndpoints...
java
public static CompletableFuture<EndpointDescription[]> getEndpoints(String endpointUrl) { UaTcpStackClientConfig config = UaTcpStackClientConfig.builder() .setEndpointUrl(endpointUrl) .build(); UaTcpStackClient client = new UaTcpStackClient(config); GetEndpoints...
[ "public", "static", "CompletableFuture", "<", "EndpointDescription", "[", "]", ">", "getEndpoints", "(", "String", "endpointUrl", ")", "{", "UaTcpStackClientConfig", "config", "=", "UaTcpStackClientConfig", ".", "builder", "(", ")", ".", "setEndpointUrl", "(", "endp...
Query the GetEndpoints service at the given endpoint URL. @param endpointUrl the endpoint URL to get endpoints from. @return the {@link EndpointDescription}s returned by the GetEndpoints service.
[ "Query", "the", "GetEndpoints", "service", "at", "the", "given", "endpoint", "URL", "." ]
007f4e5c4ff102814bec17bb7c41f27e2e52f2fd
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-client/src/main/java/com/digitalpetri/opcua/stack/client/UaTcpStackClient.java#L412-L426
train
duracloud/snapshot
snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/StepExecutionSupport.java
StepExecutionSupport.skipLinesAlreadyRead
protected void skipLinesAlreadyRead(Iterator it) { long linesRead = getItemsRead(); if (linesRead > 0) { for (long i = 0; i < linesRead; i++) { if (it.hasNext()) { it.next(); } } } }
java
protected void skipLinesAlreadyRead(Iterator it) { long linesRead = getItemsRead(); if (linesRead > 0) { for (long i = 0; i < linesRead; i++) { if (it.hasNext()) { it.next(); } } } }
[ "protected", "void", "skipLinesAlreadyRead", "(", "Iterator", "it", ")", "{", "long", "linesRead", "=", "getItemsRead", "(", ")", ";", "if", "(", "linesRead", ">", "0", ")", "{", "for", "(", "long", "i", "=", "0", ";", "i", "<", "linesRead", ";", "i"...
Skips the iterator ahead to the items read value stored in the execution context @param it any iterator
[ "Skips", "the", "iterator", "ahead", "to", "the", "items", "read", "value", "stored", "in", "the", "execution", "context" ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/StepExecutionSupport.java#L89-L98
train
duracloud/snapshot
snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/StepExecutionSupport.java
StepExecutionSupport.addToLong
protected void addToLong(String key, long value) { synchronized (this.stepExecution) { long currentValue = getLongValue(key); getExecutionContext().putLong(key, currentValue + value); } }
java
protected void addToLong(String key, long value) { synchronized (this.stepExecution) { long currentValue = getLongValue(key); getExecutionContext().putLong(key, currentValue + value); } }
[ "protected", "void", "addToLong", "(", "String", "key", ",", "long", "value", ")", "{", "synchronized", "(", "this", ".", "stepExecution", ")", "{", "long", "currentValue", "=", "getLongValue", "(", "key", ")", ";", "getExecutionContext", "(", ")", ".", "p...
Adds the specified value to the existing key. @param key @param value
[ "Adds", "the", "specified", "value", "to", "the", "existing", "key", "." ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/StepExecutionSupport.java#L141-L147
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/Prefs.java
Prefs.reload
public void reload() { try { if (file.exists()) { try(FileReader fileReader = new FileReader(file)) { props.load(fileReader); } } } catch (IOException e) { FOKLogger.log(Prefs.class.getName(), Level.SEVERE, FOKLogge...
java
public void reload() { try { if (file.exists()) { try(FileReader fileReader = new FileReader(file)) { props.load(fileReader); } } } catch (IOException e) { FOKLogger.log(Prefs.class.getName(), Level.SEVERE, FOKLogge...
[ "public", "void", "reload", "(", ")", "{", "try", "{", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "try", "(", "FileReader", "fileReader", "=", "new", "FileReader", "(", "file", ")", ")", "{", "props", ".", "load", "(", "fileReader", ")",...
Reloads this preference file from the hard disk
[ "Reloads", "this", "preference", "file", "from", "the", "hard", "disk" ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/Prefs.java#L54-L65
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/Prefs.java
Prefs.setPreference
public void setPreference(String prefKey, String prefValue) { props.setProperty(prefKey, prefValue); savePreferences(); }
java
public void setPreference(String prefKey, String prefValue) { props.setProperty(prefKey, prefValue); savePreferences(); }
[ "public", "void", "setPreference", "(", "String", "prefKey", ",", "String", "prefValue", ")", "{", "props", ".", "setProperty", "(", "prefKey", ",", "prefValue", ")", ";", "savePreferences", "(", ")", ";", "}" ]
Sets the value of the specified preference in the properties file @param prefKey The key of the preference to save @param prefValue The value of the preference to save
[ "Sets", "the", "value", "of", "the", "specified", "preference", "in", "the", "properties", "file" ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/Prefs.java#L73-L76
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/Prefs.java
Prefs.getPreference
public String getPreference(String prefKey, String defaultValue) { return props.getProperty(prefKey, defaultValue); }
java
public String getPreference(String prefKey, String defaultValue) { return props.getProperty(prefKey, defaultValue); }
[ "public", "String", "getPreference", "(", "String", "prefKey", ",", "String", "defaultValue", ")", "{", "return", "props", ".", "getProperty", "(", "prefKey", ",", "defaultValue", ")", ";", "}" ]
Returns the value of the specified preference. @param prefKey The preference to look for @param defaultValue The value to be returned if the key was not found in the properties file @return The value of the specified preference or the {@code defaultValue} if the key was not found
[ "Returns", "the", "value", "of", "the", "specified", "preference", "." ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/Prefs.java#L85-L87
train
cloudiator/sword
drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java
JCloudsComputeModule.overrideImageSupplier
protected Supplier<Set<Image>> overrideImageSupplier(Injector injector, Supplier<Set<Image>> originalSupplier) { return originalSupplier; }
java
protected Supplier<Set<Image>> overrideImageSupplier(Injector injector, Supplier<Set<Image>> originalSupplier) { return originalSupplier; }
[ "protected", "Supplier", "<", "Set", "<", "Image", ">", ">", "overrideImageSupplier", "(", "Injector", "injector", ",", "Supplier", "<", "Set", "<", "Image", ">", ">", "originalSupplier", ")", "{", "return", "originalSupplier", ";", "}" ]
Allows jclouds submodules to override the image supplier
[ "Allows", "jclouds", "submodules", "to", "override", "the", "image", "supplier" ]
b7808ea2776c6d70d439342c403369dfc5bb26bc
https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java#L108-L111
train
cloudiator/sword
drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java
JCloudsComputeModule.overrideLocationSupplier
protected Supplier<Set<Location>> overrideLocationSupplier(Injector injector, Supplier<Set<Location>> originalSupplier) { return originalSupplier; }
java
protected Supplier<Set<Location>> overrideLocationSupplier(Injector injector, Supplier<Set<Location>> originalSupplier) { return originalSupplier; }
[ "protected", "Supplier", "<", "Set", "<", "Location", ">", ">", "overrideLocationSupplier", "(", "Injector", "injector", ",", "Supplier", "<", "Set", "<", "Location", ">", ">", "originalSupplier", ")", "{", "return", "originalSupplier", ";", "}" ]
Allows jclouds submodules to override the location supplier
[ "Allows", "jclouds", "submodules", "to", "override", "the", "location", "supplier" ]
b7808ea2776c6d70d439342c403369dfc5bb26bc
https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java#L121-L124
train
cloudiator/sword
drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java
JCloudsComputeModule.overrideHardwareFlavorSupplier
protected Supplier<Set<HardwareFlavor>> overrideHardwareFlavorSupplier(Injector injector, Supplier<Set<HardwareFlavor>> originalSupplier) { return originalSupplier; }
java
protected Supplier<Set<HardwareFlavor>> overrideHardwareFlavorSupplier(Injector injector, Supplier<Set<HardwareFlavor>> originalSupplier) { return originalSupplier; }
[ "protected", "Supplier", "<", "Set", "<", "HardwareFlavor", ">", ">", "overrideHardwareFlavorSupplier", "(", "Injector", "injector", ",", "Supplier", "<", "Set", "<", "HardwareFlavor", ">", ">", "originalSupplier", ")", "{", "return", "originalSupplier", ";", "}" ...
Allows jclouds submodules to override the hardware supplier
[ "Allows", "jclouds", "submodules", "to", "override", "the", "hardware", "supplier" ]
b7808ea2776c6d70d439342c403369dfc5bb26bc
https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java#L135-L138
train
cloudiator/sword
drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java
JCloudsComputeModule.overrideVirtualMachineSupplier
protected Supplier<Set<VirtualMachine>> overrideVirtualMachineSupplier(Injector injector, Supplier<Set<VirtualMachine>> originalSupplier) { return originalSupplier; }
java
protected Supplier<Set<VirtualMachine>> overrideVirtualMachineSupplier(Injector injector, Supplier<Set<VirtualMachine>> originalSupplier) { return originalSupplier; }
[ "protected", "Supplier", "<", "Set", "<", "VirtualMachine", ">", ">", "overrideVirtualMachineSupplier", "(", "Injector", "injector", ",", "Supplier", "<", "Set", "<", "VirtualMachine", ">", ">", "originalSupplier", ")", "{", "return", "originalSupplier", ";", "}" ...
Allows jclouds submodules to override the VirtualMachine supplier
[ "Allows", "jclouds", "submodules", "to", "override", "the", "VirtualMachine", "supplier" ]
b7808ea2776c6d70d439342c403369dfc5bb26bc
https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/config/JCloudsComputeModule.java#L149-L152
train
cloudiator/sword
core/src/main/java/de/uniulm/omi/cloudiator/sword/domain/TemplateOptionsBuilder.java
TemplateOptionsBuilder.addOption
public TemplateOptionsBuilder addOption(Object field, Object value) { additionalOptions.put(field, value); return this; }
java
public TemplateOptionsBuilder addOption(Object field, Object value) { additionalOptions.put(field, value); return this; }
[ "public", "TemplateOptionsBuilder", "addOption", "(", "Object", "field", ",", "Object", "value", ")", "{", "additionalOptions", ".", "put", "(", "field", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds a generic option to the template @param field key of the option @param value value of the option @return fluid interface
[ "Adds", "a", "generic", "option", "to", "the", "template" ]
b7808ea2776c6d70d439342c403369dfc5bb26bc
https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/core/src/main/java/de/uniulm/omi/cloudiator/sword/domain/TemplateOptionsBuilder.java#L88-L91
train
cloudiator/sword
core/src/main/java/de/uniulm/omi/cloudiator/sword/domain/LocationBuilder.java
LocationBuilder.build
public Location build() { return new LocationImpl(id, providerId, name, parent, isAssignable, locationScope, geoLocation, tags); }
java
public Location build() { return new LocationImpl(id, providerId, name, parent, isAssignable, locationScope, geoLocation, tags); }
[ "public", "Location", "build", "(", ")", "{", "return", "new", "LocationImpl", "(", "id", ",", "providerId", ",", "name", ",", "parent", ",", "isAssignable", ",", "locationScope", ",", "geoLocation", ",", "tags", ")", ";", "}" ]
Builds the location. @return the location.
[ "Builds", "the", "location", "." ]
b7808ea2776c6d70d439342c403369dfc5bb26bc
https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/core/src/main/java/de/uniulm/omi/cloudiator/sword/domain/LocationBuilder.java#L76-L79
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/StringCommon.java
StringCommon.fromFile
public static String fromFile(File file) throws IOException { BufferedReader br = new BufferedReader(new FileReader(file)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); line = br.readLine(); ...
java
public static String fromFile(File file) throws IOException { BufferedReader br = new BufferedReader(new FileReader(file)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); line = br.readLine(); ...
[ "public", "static", "String", "fromFile", "(", "File", "file", ")", "throws", "IOException", "{", "BufferedReader", "br", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "file", ")", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", ...
Reads the text from a text file @param file The file to read @return The text in that text file @throws IOException if the file cannot be read
[ "Reads", "the", "text", "from", "a", "text", "file" ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/StringCommon.java#L45-L59
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/StringCommon.java
StringCommon.getRequiredSpaces
private static String getRequiredSpaces(String reference, String message) { StringBuilder res = new StringBuilder(); int requiredSpaces = reference.length() - message.length() - 4; for (int i = 0; i < requiredSpaces; i++) { res.append(" "); } return res.toString(); ...
java
private static String getRequiredSpaces(String reference, String message) { StringBuilder res = new StringBuilder(); int requiredSpaces = reference.length() - message.length() - 4; for (int i = 0; i < requiredSpaces; i++) { res.append(" "); } return res.toString(); ...
[ "private", "static", "String", "getRequiredSpaces", "(", "String", "reference", ",", "String", "message", ")", "{", "StringBuilder", "res", "=", "new", "StringBuilder", "(", ")", ";", "int", "requiredSpaces", "=", "reference", ".", "length", "(", ")", "-", "...
Formats a message to be printed on the console @param message The line to be formatted @return The formatted version of {@code message}
[ "Formats", "a", "message", "to", "be", "printed", "on", "the", "console" ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/StringCommon.java#L90-L99
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/Config.java
Config.readRemoteConfig
private void readRemoteConfig(URL remoteConfig, URL fallbackConfig, boolean cacheRemoteConfig, String cacheFileName) throws IOException { // Check if offline cache exists checkForOfflineCacheOrLoadFallback(fallbackConfig, cacheFileName); if (!isOfflineMode()) ...
java
private void readRemoteConfig(URL remoteConfig, URL fallbackConfig, boolean cacheRemoteConfig, String cacheFileName) throws IOException { // Check if offline cache exists checkForOfflineCacheOrLoadFallback(fallbackConfig, cacheFileName); if (!isOfflineMode()) ...
[ "private", "void", "readRemoteConfig", "(", "URL", "remoteConfig", ",", "URL", "fallbackConfig", ",", "boolean", "cacheRemoteConfig", ",", "String", "cacheFileName", ")", "throws", "IOException", "{", "// Check if offline cache exists", "checkForOfflineCacheOrLoadFallback", ...
Reads the config from the remote url synchronously. If this fails for any reason and a cached config is available, the cached config is used instead. If the remote config can't be read and no cached version is available, the fallbackConfig is used. @param remoteConfig The {@code URL} of the remote config to be re...
[ "Reads", "the", "config", "from", "the", "remote", "url", "synchronously", ".", "If", "this", "fails", "for", "any", "reason", "and", "a", "cached", "config", "is", "available", "the", "cached", "config", "is", "used", "instead", ".", "If", "the", "remote"...
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/Config.java#L186-L192
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/Config.java
Config.contains
public boolean contains(String key) { return onlineProps.getProperty(key) != null || offlineProps.getProperty(key) != null; }
java
public boolean contains(String key) { return onlineProps.getProperty(key) != null || offlineProps.getProperty(key) != null; }
[ "public", "boolean", "contains", "(", "String", "key", ")", "{", "return", "onlineProps", ".", "getProperty", "(", "key", ")", "!=", "null", "||", "offlineProps", ".", "getProperty", "(", "key", ")", "!=", "null", ";", "}" ]
Checks if the specified key is defined in this Config file. @param key The key of the property to be checked. @return {@code true} if a property with the specified key is found, {@code false} otherwise.
[ "Checks", "if", "the", "specified", "key", "is", "defined", "in", "this", "Config", "file", "." ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/Config.java#L264-L266
train
vatbub/common
updater/src/main/java/com/github/vatbub/common/updater/VersionList.java
VersionList.removeSnapshots
public void removeSnapshots() { VersionList versionToRemove = new VersionList(); // collect Versions to be removed for (Version ver : this) { if (ver.isSnapshot()) { versionToRemove.add(ver); } } // remove them this.removeAll(vers...
java
public void removeSnapshots() { VersionList versionToRemove = new VersionList(); // collect Versions to be removed for (Version ver : this) { if (ver.isSnapshot()) { versionToRemove.add(ver); } } // remove them this.removeAll(vers...
[ "public", "void", "removeSnapshots", "(", ")", "{", "VersionList", "versionToRemove", "=", "new", "VersionList", "(", ")", ";", "// collect Versions to be removed", "for", "(", "Version", "ver", ":", "this", ")", "{", "if", "(", "ver", ".", "isSnapshot", "(", ...
Removes all snapshots from this list
[ "Removes", "all", "snapshots", "from", "this", "list" ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/VersionList.java#L53-L65
train
vatbub/common
view/motd/core/src/main/java/com/github/vatbub/common/view/motd/PlatformIndependentMOTD.java
PlatformIndependentMOTD.markAsRead
public void markAsRead() throws IOException, ClassNotFoundException { if (!this.isMarkedAsRead()) { FileOutputStream fileOut = getMotdFileOutputStreamProvider().createFileOutputStream(getNextSerializationFileName()); ObjectOutputStream out = new ObjectOutputStream(fileOut); o...
java
public void markAsRead() throws IOException, ClassNotFoundException { if (!this.isMarkedAsRead()) { FileOutputStream fileOut = getMotdFileOutputStreamProvider().createFileOutputStream(getNextSerializationFileName()); ObjectOutputStream out = new ObjectOutputStream(fileOut); o...
[ "public", "void", "markAsRead", "(", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "if", "(", "!", "this", ".", "isMarkedAsRead", "(", ")", ")", "{", "FileOutputStream", "fileOut", "=", "getMotdFileOutputStreamProvider", "(", ")", ".", "creat...
Marks this message of the day as read. @throws IOException If the info if this message of the day is marked as read cannot be read from the computers hard disk @throws ClassNotFoundException This exception occurs if you did not add the <a href="https://rometools.github.io/rome/index.html">ROME library</a> t...
[ "Marks", "this", "message", "of", "the", "day", "as", "read", "." ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/view/motd/core/src/main/java/com/github/vatbub/common/view/motd/PlatformIndependentMOTD.java#L253-L261
train
vatbub/common
core/src/main/java/com/github/vatbub/common/core/linux/DesktopFile.java
DesktopFile.isValid
public boolean isValid() { if (name == null) { return false; } if (type == null || !type.isValid()) { return false; } else if (type == Type.Link) { if (url == null) { return false; } } // Check actions ...
java
public boolean isValid() { if (name == null) { return false; } if (type == null || !type.isValid()) { return false; } else if (type == Type.Link) { if (url == null) { return false; } } // Check actions ...
[ "public", "boolean", "isValid", "(", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "type", "==", "null", "||", "!", "type", ".", "isValid", "(", ")", ")", "{", "return", "false", ";", "}", "else", ...
Checks if this link is valid to be saved @return {@code true} if this link is valid, {@code false} if not.
[ "Checks", "if", "this", "link", "is", "valid", "to", "be", "saved" ]
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/linux/DesktopFile.java#L1563-L1587
train
lastaflute/lasta-thymeleaf
src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java
ClassificationExpressionObject.list
public List<Classification> list(String classificationName) { assertArgumentNotNull("classificationName", classificationName); final String delimiter = GROUP_DELIMITER; final String pureName; final String groupName; if (classificationName.contains(delimiter)) { // e.g. sea.land o...
java
public List<Classification> list(String classificationName) { assertArgumentNotNull("classificationName", classificationName); final String delimiter = GROUP_DELIMITER; final String pureName; final String groupName; if (classificationName.contains(delimiter)) { // e.g. sea.land o...
[ "public", "List", "<", "Classification", ">", "list", "(", "String", "classificationName", ")", "{", "assertArgumentNotNull", "(", "\"classificationName\"", ",", "classificationName", ")", ";", "final", "String", "delimiter", "=", "GROUP_DELIMITER", ";", "final", "S...
Get list of specified classification. @param classificationName The name of classification, can contain group name by delimiter. (NotNull) @return The list of all classification. (NotNull)
[ "Get", "list", "of", "specified", "classification", "." ]
d340a6e7eeddfcc9177052958c383fecd4a7fefa
https://github.com/lastaflute/lasta-thymeleaf/blob/d340a6e7eeddfcc9177052958c383fecd4a7fefa/src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java#L84-L108
train
lastaflute/lasta-thymeleaf
src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java
ClassificationExpressionObject.listAll
public List<Classification> listAll(String classificationName) { assertArgumentNotNull("classificationName", classificationName); return findClassificationMeta(classificationName, () -> { return "listAll('" + classificationName + "')"; }).listAll(); }
java
public List<Classification> listAll(String classificationName) { assertArgumentNotNull("classificationName", classificationName); return findClassificationMeta(classificationName, () -> { return "listAll('" + classificationName + "')"; }).listAll(); }
[ "public", "List", "<", "Classification", ">", "listAll", "(", "String", "classificationName", ")", "{", "assertArgumentNotNull", "(", "\"classificationName\"", ",", "classificationName", ")", ";", "return", "findClassificationMeta", "(", "classificationName", ",", "(", ...
Get list of all classification. @param classificationName The name of classification. (NotNull) @return The list of all classification. (NotNull)
[ "Get", "list", "of", "all", "classification", "." ]
d340a6e7eeddfcc9177052958c383fecd4a7fefa
https://github.com/lastaflute/lasta-thymeleaf/blob/d340a6e7eeddfcc9177052958c383fecd4a7fefa/src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java#L118-L123
train
lastaflute/lasta-thymeleaf
src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java
ClassificationExpressionObject.alias
public String alias(Object cls, String defaultValue) { assertArgumentNotNull("defaultValue", defaultValue); if (cls != null) { return alias(cls); } else { return defaultValue; } }
java
public String alias(Object cls, String defaultValue) { assertArgumentNotNull("defaultValue", defaultValue); if (cls != null) { return alias(cls); } else { return defaultValue; } }
[ "public", "String", "alias", "(", "Object", "cls", ",", "String", "defaultValue", ")", "{", "assertArgumentNotNull", "(", "\"defaultValue\"", ",", "defaultValue", ")", ";", "if", "(", "cls", "!=", "null", ")", "{", "return", "alias", "(", "cls", ")", ";", ...
Get classification alias or default value if the classification is null. @param cls The instance of classification to get code. (NotNull) @param defaultValue The default value for no classification. (NotNull, EmptyAllowed) @return The alias of classification. (NotNull: if not classification, throws exception)
[ "Get", "classification", "alias", "or", "default", "value", "if", "the", "classification", "is", "null", "." ]
d340a6e7eeddfcc9177052958c383fecd4a7fefa
https://github.com/lastaflute/lasta-thymeleaf/blob/d340a6e7eeddfcc9177052958c383fecd4a7fefa/src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java#L145-L152
train
lastaflute/lasta-thymeleaf
src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java
ClassificationExpressionObject.codeOf
public Classification codeOf(String classificationName, String code) { assertArgumentNotNull("elementName", classificationName); assertArgumentNotNull("code", code); return findClassificationMeta(classificationName, () -> { return "codeOf('" + classificationName + "', '" + code + "')...
java
public Classification codeOf(String classificationName, String code) { assertArgumentNotNull("elementName", classificationName); assertArgumentNotNull("code", code); return findClassificationMeta(classificationName, () -> { return "codeOf('" + classificationName + "', '" + code + "')...
[ "public", "Classification", "codeOf", "(", "String", "classificationName", ",", "String", "code", ")", "{", "assertArgumentNotNull", "(", "\"elementName\"", ",", "classificationName", ")", ";", "assertArgumentNotNull", "(", "\"code\"", ",", "code", ")", ";", "return...
Get classification by code. @param classificationName The name of classification. (NotNull) @param code The code of classification to find. (NotNull) @return The found instance of classification for the code. (NotNull: if not found, throws exception)
[ "Get", "classification", "by", "code", "." ]
d340a6e7eeddfcc9177052958c383fecd4a7fefa
https://github.com/lastaflute/lasta-thymeleaf/blob/d340a6e7eeddfcc9177052958c383fecd4a7fefa/src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java#L211-L217
train
lastaflute/lasta-thymeleaf
src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java
ClassificationExpressionObject.nameOf
public Classification nameOf(String classificationName, String name) { return findClassificationMeta((String) classificationName, () -> { return "nameOf('" + classificationName + "', '" + name + "')"; }).nameOf(name); }
java
public Classification nameOf(String classificationName, String name) { return findClassificationMeta((String) classificationName, () -> { return "nameOf('" + classificationName + "', '" + name + "')"; }).nameOf(name); }
[ "public", "Classification", "nameOf", "(", "String", "classificationName", ",", "String", "name", ")", "{", "return", "findClassificationMeta", "(", "(", "String", ")", "classificationName", ",", "(", ")", "->", "{", "return", "\"nameOf('\"", "+", "classificationN...
Get classification by name. @param classificationName The name of classification. (NotNull) @param name The name of classification to find. (NotNull) @return The found instance of classification for the code. (NotNull: if not found, throws exception)
[ "Get", "classification", "by", "name", "." ]
d340a6e7eeddfcc9177052958c383fecd4a7fefa
https://github.com/lastaflute/lasta-thymeleaf/blob/d340a6e7eeddfcc9177052958c383fecd4a7fefa/src/main/java/org/lastaflute/thymeleaf/expression/ClassificationExpressionObject.java#L225-L229
train
cloudiator/sword
core/src/main/java/de/uniulm/omi/cloudiator/sword/strategy/DefaultGetStrategy.java
DefaultGetStrategy.get
@Nullable @Override public T get(String s) { checkNotNull(s); checkArgument(!s.isEmpty()); for (T t : supplier.get()) { if (t.id().equals(s)) { return t; } } return null; }
java
@Nullable @Override public T get(String s) { checkNotNull(s); checkArgument(!s.isEmpty()); for (T t : supplier.get()) { if (t.id().equals(s)) { return t; } } return null; }
[ "@", "Nullable", "@", "Override", "public", "T", "get", "(", "String", "s", ")", "{", "checkNotNull", "(", "s", ")", ";", "checkArgument", "(", "!", "s", ".", "isEmpty", "(", ")", ")", ";", "for", "(", "T", "t", ":", "supplier", ".", "get", "(", ...
Searches for the given id in the supplier. @param s the id. @return the found resource or null. @throws NullPointerException if the given id is null. @throws IllegalArgumentException if the given id is empty.
[ "Searches", "for", "the", "given", "id", "in", "the", "supplier", "." ]
b7808ea2776c6d70d439342c403369dfc5bb26bc
https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/core/src/main/java/de/uniulm/omi/cloudiator/sword/strategy/DefaultGetStrategy.java#L65-L76
train
vatbub/common
updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java
UpdateChecker.isUpdateAvailable
public static UpdateInfo isUpdateAvailable(URL repoBaseURL, String mavenGroupID, String mavenArtifactID, String mavenClassifier) { return isUpdateAvailable(repoBaseURL, mavenGroupID, mavenArtifactID, mavenClassifier, "jar"); }
java
public static UpdateInfo isUpdateAvailable(URL repoBaseURL, String mavenGroupID, String mavenArtifactID, String mavenClassifier) { return isUpdateAvailable(repoBaseURL, mavenGroupID, mavenArtifactID, mavenClassifier, "jar"); }
[ "public", "static", "UpdateInfo", "isUpdateAvailable", "(", "URL", "repoBaseURL", ",", "String", "mavenGroupID", ",", "String", "mavenArtifactID", ",", "String", "mavenClassifier", ")", "{", "return", "isUpdateAvailable", "(", "repoBaseURL", ",", "mavenGroupID", ",", ...
Checks if a new release has been published on the website. This does not compare the current app version to the release version on the website, just checks if something happened on the website. This ensures that updates that were ignored by the user do not show up again. Assumes that the artifact has a jar-packaging. ...
[ "Checks", "if", "a", "new", "release", "has", "been", "published", "on", "the", "website", ".", "This", "does", "not", "compare", "the", "current", "app", "version", "to", "the", "release", "version", "on", "the", "website", "just", "checks", "if", "someth...
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L104-L107
train
vatbub/common
updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java
UpdateChecker.isUpdateAvailable
@SuppressWarnings("Duplicates") public static UpdateInfo isUpdateAvailable(URL repoBaseURL, String mavenGroupID, String mavenArtifactID, String mavenClassifier, @SuppressWarnings("SameParameterValue") String packaging) { String savedSetting = updatePrefs.getPre...
java
@SuppressWarnings("Duplicates") public static UpdateInfo isUpdateAvailable(URL repoBaseURL, String mavenGroupID, String mavenArtifactID, String mavenClassifier, @SuppressWarnings("SameParameterValue") String packaging) { String savedSetting = updatePrefs.getPre...
[ "@", "SuppressWarnings", "(", "\"Duplicates\"", ")", "public", "static", "UpdateInfo", "isUpdateAvailable", "(", "URL", "repoBaseURL", ",", "String", "mavenGroupID", ",", "String", "mavenArtifactID", ",", "String", "mavenClassifier", ",", "@", "SuppressWarnings", "(",...
Checks if a new release has been published on the website. This does not compare the current app version to the release version on the website, just checks if something happened on the website. This ensures that updates that were ignored by the user do not show up again. @param repoBaseURL The base url of the mave...
[ "Checks", "if", "a", "new", "release", "has", "been", "published", "on", "the", "website", ".", "This", "does", "not", "compare", "the", "current", "app", "version", "to", "the", "release", "version", "on", "the", "website", "just", "checks", "if", "someth...
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L124-L170
train
vatbub/common
updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java
UpdateChecker.isUpdateAvailableCompareAppVersion
public static UpdateInfo isUpdateAvailableCompareAppVersion(URL repoBaseURL, String mavenGroupID, String mavenArtifactID, String mavenClassifier) { return isUpdateAvailableCompareAppVersion(repoBaseURL, mavenGroupID, mavenArtifactID, mavenClassifie...
java
public static UpdateInfo isUpdateAvailableCompareAppVersion(URL repoBaseURL, String mavenGroupID, String mavenArtifactID, String mavenClassifier) { return isUpdateAvailableCompareAppVersion(repoBaseURL, mavenGroupID, mavenArtifactID, mavenClassifie...
[ "public", "static", "UpdateInfo", "isUpdateAvailableCompareAppVersion", "(", "URL", "repoBaseURL", ",", "String", "mavenGroupID", ",", "String", "mavenArtifactID", ",", "String", "mavenClassifier", ")", "{", "return", "isUpdateAvailableCompareAppVersion", "(", "repoBaseURL"...
Checks if a new release has been published on the website. This compares the current appVersion to the version available on the website and thus does not take into account if the user ignored that update. Assumes that the artifact has a jar-packaging. @param repoBaseURL The base url of the maven repo to use @param...
[ "Checks", "if", "a", "new", "release", "has", "been", "published", "on", "the", "website", ".", "This", "compares", "the", "current", "appVersion", "to", "the", "version", "available", "on", "the", "website", "and", "thus", "does", "not", "take", "into", "...
8b9fd2ece0a23d520ce53b66c84cbd094e378443
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L185-L188
train
lastaflute/lasta-thymeleaf
src/main/java/org/lastaflute/thymeleaf/ThymeleafHtmlRenderer.java
ThymeleafHtmlRenderer.checkRegisteredDataUsingReservedWord
protected void checkRegisteredDataUsingReservedWord(ActionRuntime runtime, WebContext context, String varKey) { if (isSuppressRegisteredDataUsingReservedWordCheck()) { return; } if (context.getVariableNames().contains(varKey)) { throwThymeleafRegisteredDataUsingReservedWo...
java
protected void checkRegisteredDataUsingReservedWord(ActionRuntime runtime, WebContext context, String varKey) { if (isSuppressRegisteredDataUsingReservedWordCheck()) { return; } if (context.getVariableNames().contains(varKey)) { throwThymeleafRegisteredDataUsingReservedWo...
[ "protected", "void", "checkRegisteredDataUsingReservedWord", "(", "ActionRuntime", "runtime", ",", "WebContext", "context", ",", "String", "varKey", ")", "{", "if", "(", "isSuppressRegisteredDataUsingReservedWordCheck", "(", ")", ")", "{", "return", ";", "}", "if", ...
Thymeleaf's reserved words are already checked in Thymeleaf process so no check them here
[ "Thymeleaf", "s", "reserved", "words", "are", "already", "checked", "in", "Thymeleaf", "process", "so", "no", "check", "them", "here" ]
d340a6e7eeddfcc9177052958c383fecd4a7fefa
https://github.com/lastaflute/lasta-thymeleaf/blob/d340a6e7eeddfcc9177052958c383fecd4a7fefa/src/main/java/org/lastaflute/thymeleaf/ThymeleafHtmlRenderer.java#L178-L185
train
electrumpayments/service-interface-base
src/main/java/io/electrum/vas/model/CardPayment.java
CardPayment.getPan
@ApiModelProperty(required = true, value = "Primary account number that uniquely identifies this card.") @JsonProperty("pan") @NotNull @Pattern(regexp = "[0-9]{1,19}") @Masked public String getPan() { return pan; }
java
@ApiModelProperty(required = true, value = "Primary account number that uniquely identifies this card.") @JsonProperty("pan") @NotNull @Pattern(regexp = "[0-9]{1,19}") @Masked public String getPan() { return pan; }
[ "@", "ApiModelProperty", "(", "required", "=", "true", ",", "value", "=", "\"Primary account number that uniquely identifies this card.\"", ")", "@", "JsonProperty", "(", "\"pan\"", ")", "@", "NotNull", "@", "Pattern", "(", "regexp", "=", "\"[0-9]{1,19}\"", ")", "@"...
Primary account number that uniquely identifies this card. @return pan
[ "Primary", "account", "number", "that", "uniquely", "identifies", "this", "card", "." ]
2b731ab4eecf458e9ec869338c9cf2df2e86f986
https://github.com/electrumpayments/service-interface-base/blob/2b731ab4eecf458e9ec869338c9cf2df2e86f986/src/main/java/io/electrum/vas/model/CardPayment.java#L41-L48
train
duracloud/snapshot
snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java
SnapshotResource.complete
@Path("{snapshotId}/complete") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response complete(@PathParam("snapshotId") String snapshotId, CompleteSnapshotBridgeParameters params) { try { Snapshot snapshot = this...
java
@Path("{snapshotId}/complete") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response complete(@PathParam("snapshotId") String snapshotId, CompleteSnapshotBridgeParameters params) { try { Snapshot snapshot = this...
[ "@", "Path", "(", "\"{snapshotId}/complete\"", ")", "@", "POST", "@", "Consumes", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "public", "Response", "complete", "(", "@", "PathParam", "(", "\"...
Notifies the bridge that the snapshot transfer from the bridge storage to the preservation storage is complete. Also sets a snapshot's alternate id's if they are passed in. @param snapshotId @param params @return
[ "Notifies", "the", "bridge", "that", "the", "snapshot", "transfer", "from", "the", "bridge", "storage", "to", "the", "preservation", "storage", "is", "complete", ".", "Also", "sets", "a", "snapshot", "s", "alternate", "id", "s", "if", "they", "are", "passed"...
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java#L440-L497
train
duracloud/snapshot
snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java
SnapshotResource.error
@Path("{snapshotId}/error") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response error(@PathParam("snapshotId") String snapshotId, SnapshotErrorBridgeParameters params) { try { Snapshot snapshot = ...
java
@Path("{snapshotId}/error") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response error(@PathParam("snapshotId") String snapshotId, SnapshotErrorBridgeParameters params) { try { Snapshot snapshot = ...
[ "@", "Path", "(", "\"{snapshotId}/error\"", ")", "@", "POST", "@", "Consumes", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "public", "Response", "error", "(", "@", "PathParam", "(", "\"snapsh...
Notifies the bridge that the snapshot process is not able to continue due to an error which cannot be resolved by the system processing the snapshot data. @param snapshotId @param params @return
[ "Notifies", "the", "bridge", "that", "the", "snapshot", "process", "is", "not", "able", "to", "continue", "due", "to", "an", "error", "which", "cannot", "be", "resolved", "by", "the", "system", "processing", "the", "snapshot", "data", "." ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java#L508-L528
train
duracloud/snapshot
snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java
SnapshotResource.updateHistory
@Path("{snapshotId}/history") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateHistory(@PathParam("snapshotId") String snapshotId, UpdateSnapshotHistoryBridgeParameters params) { try { if (params...
java
@Path("{snapshotId}/history") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateHistory(@PathParam("snapshotId") String snapshotId, UpdateSnapshotHistoryBridgeParameters params) { try { if (params...
[ "@", "Path", "(", "\"{snapshotId}/history\"", ")", "@", "POST", "@", "Consumes", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "public", "Response", "updateHistory", "(", "@", "PathParam", "(", ...
Updates a snapshot's history @param snapshotId - a snapshot's ID or it's alternate ID @param params - JSON object that contains the history String and a Boolean of whether this request is using a snapshot's ID or an alternate ID @return
[ "Updates", "a", "snapshot", "s", "history" ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java#L653-L709
train
duracloud/snapshot
snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceItemWriter.java
SpaceItemWriter.onWriteError
@Override public void onWriteError(Exception e, List<? extends ContentItem> items) { StringBuilder sb = new StringBuilder(); for (ContentItem item : items) { sb.append(item.getContentId() + ", "); } String message = "Error writing item(s): " + e.getMessage() + ": items="...
java
@Override public void onWriteError(Exception e, List<? extends ContentItem> items) { StringBuilder sb = new StringBuilder(); for (ContentItem item : items) { sb.append(item.getContentId() + ", "); } String message = "Error writing item(s): " + e.getMessage() + ": items="...
[ "@", "Override", "public", "void", "onWriteError", "(", "Exception", "e", ",", "List", "<", "?", "extends", "ContentItem", ">", "items", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "ContentItem", "item", ":", ...
Method defined in ItemWriteListener interface
[ "Method", "defined", "in", "ItemWriteListener", "interface" ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceItemWriter.java#L532-L542
train
duracloud/snapshot
snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java
RestoreJobExecutionListener.changeRestoreStatus
private Date changeRestoreStatus(Restoration restoration, RestoreStatus status, String msg, Date currentDate) { log.info("Changing restore status to: " + status + " with message: " + msg); rest...
java
private Date changeRestoreStatus(Restoration restoration, RestoreStatus status, String msg, Date currentDate) { log.info("Changing restore status to: " + status + " with message: " + msg); rest...
[ "private", "Date", "changeRestoreStatus", "(", "Restoration", "restoration", ",", "RestoreStatus", "status", ",", "String", "msg", ",", "Date", "currentDate", ")", "{", "log", ".", "info", "(", "\"Changing restore status to: \"", "+", "status", "+", "\" with message...
Updates the restore details in the database @param restoration the restoration being worked @param status the new status of the restoration @param msg status text
[ "Updates", "the", "restore", "details", "in", "the", "database" ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java#L237-L253
train
duracloud/snapshot
snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java
RestoreJobExecutionListener.getExpirationDate
protected Date getExpirationDate(Date endDate, int daysToExpire) { Calendar calendar = Calendar.getInstance(); calendar.setTime(endDate); calendar.add(Calendar.DATE, daysToExpire); return calendar.getTime(); }
java
protected Date getExpirationDate(Date endDate, int daysToExpire) { Calendar calendar = Calendar.getInstance(); calendar.setTime(endDate); calendar.add(Calendar.DATE, daysToExpire); return calendar.getTime(); }
[ "protected", "Date", "getExpirationDate", "(", "Date", "endDate", ",", "int", "daysToExpire", ")", "{", "Calendar", "calendar", "=", "Calendar", ".", "getInstance", "(", ")", ";", "calendar", ".", "setTime", "(", "endDate", ")", ";", "calendar", ".", "add", ...
Calculates the restore expiration date based on the restoration end date and the number of days before retirement @param endDate date on which the restoration completed @param daysToExpire number of days the restored content should stay in place before it is retired @return expiration date of restored content
[ "Calculates", "the", "restore", "expiration", "date", "based", "on", "the", "restoration", "end", "date", "and", "the", "number", "of", "days", "before", "retirement" ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java#L264-L269
train
duracloud/snapshot
snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java
RestoreJobExecutionListener.getSnapshotTaskClient
private SnapshotTaskClient getSnapshotTaskClient(DuracloudEndPointConfig source) { return this.snapshotTaskClientHelper.create(source, bridgeConfig.getDuracloudUsername(), bridgeConfig.getDuracloudPassword())...
java
private SnapshotTaskClient getSnapshotTaskClient(DuracloudEndPointConfig source) { return this.snapshotTaskClientHelper.create(source, bridgeConfig.getDuracloudUsername(), bridgeConfig.getDuracloudPassword())...
[ "private", "SnapshotTaskClient", "getSnapshotTaskClient", "(", "DuracloudEndPointConfig", "source", ")", "{", "return", "this", ".", "snapshotTaskClientHelper", ".", "create", "(", "source", ",", "bridgeConfig", ".", "getDuracloudUsername", "(", ")", ",", "bridgeConfig"...
Build the snapshot task client - for communicating with the DuraCloud snapshot provider to perform tasks. @param source DuraCloud connection source @return task client
[ "Build", "the", "snapshot", "task", "client", "-", "for", "communicating", "with", "the", "DuraCloud", "snapshot", "provider", "to", "perform", "tasks", "." ]
7cb387b22fd4a9425087f654276138727c2c0b73
https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java#L288-L292
train