id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
59,100 | cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitInterval | public T visitInterval(Interval elm, C context) {
if (elm.getLow() != null) {
visitElement(elm.getLow(), context);
}
if (elm.getLowClosedExpression() != null) {
visitElement(elm.getLowClosedExpression(), context);
}
if (elm.getHigh() != null) {
... | java | public T visitInterval(Interval elm, C context) {
if (elm.getLow() != null) {
visitElement(elm.getLow(), context);
}
if (elm.getLowClosedExpression() != null) {
visitElement(elm.getLowClosedExpression(), context);
}
if (elm.getHigh() != null) {
... | [
"public",
"T",
"visitInterval",
"(",
"Interval",
"elm",
",",
"C",
"context",
")",
"{",
"if",
"(",
"elm",
".",
"getLow",
"(",
")",
"!=",
"null",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getLow",
"(",
")",
",",
"context",
")",
";",
"}",
"if",
"(... | Visit a Interval. This method will be called for
every node in the tree that is a Interval.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"Interval",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"Interval",
"."
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L511-L525 |
59,101 | cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitList | public T visitList(List elm, C context) {
if (elm.getTypeSpecifier() != null) {
visitElement(elm.getTypeSpecifier(), context);
}
for (Expression element : elm.getElement()) {
visitElement(element, context);
}
return null;
} | java | public T visitList(List elm, C context) {
if (elm.getTypeSpecifier() != null) {
visitElement(elm.getTypeSpecifier(), context);
}
for (Expression element : elm.getElement()) {
visitElement(element, context);
}
return null;
} | [
"public",
"T",
"visitList",
"(",
"List",
"elm",
",",
"C",
"context",
")",
"{",
"if",
"(",
"elm",
".",
"getTypeSpecifier",
"(",
")",
"!=",
"null",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getTypeSpecifier",
"(",
")",
",",
"context",
")",
";",
"}",
... | Visit a List. This method will be called for
every node in the tree that is a List.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"List",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"List",
"."
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L535-L543 |
59,102 | cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java | LibraryBuilder.recordParsingException | public void recordParsingException(CqlTranslatorException e) {
addException(e);
if (shouldReport(e.getSeverity())) {
CqlToElmError err = af.createCqlToElmError();
err.setMessage(e.getMessage());
err.setErrorType(e instanceof CqlSyntaxException ? ErrorType.SYNTAX : (e ... | java | public void recordParsingException(CqlTranslatorException e) {
addException(e);
if (shouldReport(e.getSeverity())) {
CqlToElmError err = af.createCqlToElmError();
err.setMessage(e.getMessage());
err.setErrorType(e instanceof CqlSyntaxException ? ErrorType.SYNTAX : (e ... | [
"public",
"void",
"recordParsingException",
"(",
"CqlTranslatorException",
"e",
")",
"{",
"addException",
"(",
"e",
")",
";",
"if",
"(",
"shouldReport",
"(",
"e",
".",
"getSeverity",
"(",
")",
")",
")",
"{",
"CqlToElmError",
"err",
"=",
"af",
".",
"createC... | Record any errors while parsing in both the list of errors but also in the library
itself so they can be processed easily by a remote client
@param e the exception to record | [
"Record",
"any",
"errors",
"while",
"parsing",
"in",
"both",
"the",
"list",
"of",
"errors",
"but",
"also",
"in",
"the",
"library",
"itself",
"so",
"they",
"can",
"be",
"processed",
"easily",
"by",
"a",
"remote",
"client"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java#L405-L427 |
59,103 | cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java | SystemFunctionResolver.resolveCalculateAge | private CalculateAge resolveCalculateAge(Expression e, DateTimePrecision p) {
CalculateAge operator = of.createCalculateAge()
.withPrecision(p)
.withOperand(e);
builder.resolveUnaryCall("System", "CalculateAge", operator);
return operator;
} | java | private CalculateAge resolveCalculateAge(Expression e, DateTimePrecision p) {
CalculateAge operator = of.createCalculateAge()
.withPrecision(p)
.withOperand(e);
builder.resolveUnaryCall("System", "CalculateAge", operator);
return operator;
} | [
"private",
"CalculateAge",
"resolveCalculateAge",
"(",
"Expression",
"e",
",",
"DateTimePrecision",
"p",
")",
"{",
"CalculateAge",
"operator",
"=",
"of",
".",
"createCalculateAge",
"(",
")",
".",
"withPrecision",
"(",
"p",
")",
".",
"withOperand",
"(",
"e",
")... | Age-Related Function Support | [
"Age",
"-",
"Related",
"Function",
"Support"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java#L352-L359 |
59,104 | cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java | SystemFunctionResolver.resolveRound | private Round resolveRound(FunctionRef fun) {
if (fun.getOperand().isEmpty() || fun.getOperand().size() > 2) {
throw new IllegalArgumentException("Could not resolve call to system operator Round. Expected 1 or 2 arguments.");
}
final Round round = of.createRound().withOperand(fun.ge... | java | private Round resolveRound(FunctionRef fun) {
if (fun.getOperand().isEmpty() || fun.getOperand().size() > 2) {
throw new IllegalArgumentException("Could not resolve call to system operator Round. Expected 1 or 2 arguments.");
}
final Round round = of.createRound().withOperand(fun.ge... | [
"private",
"Round",
"resolveRound",
"(",
"FunctionRef",
"fun",
")",
"{",
"if",
"(",
"fun",
".",
"getOperand",
"(",
")",
".",
"isEmpty",
"(",
")",
"||",
"fun",
".",
"getOperand",
"(",
")",
".",
"size",
"(",
")",
">",
"2",
")",
"{",
"throw",
"new",
... | Arithmetic Function Support | [
"Arithmetic",
"Function",
"Support"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java#L402-L412 |
59,105 | cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java | SystemFunctionResolver.resolveDateTime | private DateTime resolveDateTime(FunctionRef fun) {
final DateTime dt = of.createDateTime();
DateTimeInvocation.setDateTimeFieldsFromOperands(dt, fun.getOperand());
builder.resolveCall("System", "DateTime", new DateTimeInvocation(dt));
return dt;
} | java | private DateTime resolveDateTime(FunctionRef fun) {
final DateTime dt = of.createDateTime();
DateTimeInvocation.setDateTimeFieldsFromOperands(dt, fun.getOperand());
builder.resolveCall("System", "DateTime", new DateTimeInvocation(dt));
return dt;
} | [
"private",
"DateTime",
"resolveDateTime",
"(",
"FunctionRef",
"fun",
")",
"{",
"final",
"DateTime",
"dt",
"=",
"of",
".",
"createDateTime",
"(",
")",
";",
"DateTimeInvocation",
".",
"setDateTimeFieldsFromOperands",
"(",
"dt",
",",
"fun",
".",
"getOperand",
"(",
... | DateTime Function Support | [
"DateTime",
"Function",
"Support"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java#L416-L421 |
59,106 | cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java | SystemFunctionResolver.resolveIndexOf | private IndexOf resolveIndexOf(FunctionRef fun) {
checkNumberOfOperands(fun, 2);
final IndexOf indexOf = of.createIndexOf();
indexOf.setSource(fun.getOperand().get(0));
indexOf.setElement(fun.getOperand().get(1));
builder.resolveCall("System", "IndexOf", new IndexOfInvocation(ind... | java | private IndexOf resolveIndexOf(FunctionRef fun) {
checkNumberOfOperands(fun, 2);
final IndexOf indexOf = of.createIndexOf();
indexOf.setSource(fun.getOperand().get(0));
indexOf.setElement(fun.getOperand().get(1));
builder.resolveCall("System", "IndexOf", new IndexOfInvocation(ind... | [
"private",
"IndexOf",
"resolveIndexOf",
"(",
"FunctionRef",
"fun",
")",
"{",
"checkNumberOfOperands",
"(",
"fun",
",",
"2",
")",
";",
"final",
"IndexOf",
"indexOf",
"=",
"of",
".",
"createIndexOf",
"(",
")",
";",
"indexOf",
".",
"setSource",
"(",
"fun",
".... | List Function Support | [
"List",
"Function",
"Support"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java#L460-L467 |
59,107 | cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java | SystemFunctionResolver.resolveCombine | private Combine resolveCombine(FunctionRef fun) {
if (fun.getOperand().isEmpty() || fun.getOperand().size() > 2) {
throw new IllegalArgumentException("Could not resolve call to system operator Combine. Expected 1 or 2 arguments.");
}
final Combine combine = of.createCombine().withSo... | java | private Combine resolveCombine(FunctionRef fun) {
if (fun.getOperand().isEmpty() || fun.getOperand().size() > 2) {
throw new IllegalArgumentException("Could not resolve call to system operator Combine. Expected 1 or 2 arguments.");
}
final Combine combine = of.createCombine().withSo... | [
"private",
"Combine",
"resolveCombine",
"(",
"FunctionRef",
"fun",
")",
"{",
"if",
"(",
"fun",
".",
"getOperand",
"(",
")",
".",
"isEmpty",
"(",
")",
"||",
"fun",
".",
"getOperand",
"(",
")",
".",
"size",
"(",
")",
">",
"2",
")",
"{",
"throw",
"new... | String Function Support | [
"String",
"Function",
"Support"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java#L519-L529 |
59,108 | cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java | SystemFunctionResolver.resolveUnary | private UnaryExpression resolveUnary(FunctionRef fun) {
UnaryExpression operator = null;
try {
Class clazz = Class.forName("org.hl7.elm.r1." + fun.getName());
if (UnaryExpression.class.isAssignableFrom(clazz)) {
operator = (UnaryExpression) clazz.newInstance();
... | java | private UnaryExpression resolveUnary(FunctionRef fun) {
UnaryExpression operator = null;
try {
Class clazz = Class.forName("org.hl7.elm.r1." + fun.getName());
if (UnaryExpression.class.isAssignableFrom(clazz)) {
operator = (UnaryExpression) clazz.newInstance();
... | [
"private",
"UnaryExpression",
"resolveUnary",
"(",
"FunctionRef",
"fun",
")",
"{",
"UnaryExpression",
"operator",
"=",
"null",
";",
"try",
"{",
"Class",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"\"org.hl7.elm.r1.\"",
"+",
"fun",
".",
"getName",
"(",
")",
... | General Function Support | [
"General",
"Function",
"Support"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java#L645-L660 |
59,109 | jgilfelt/SystemBarTint | library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java | SystemBarTintManager.setStatusBarTintEnabled | public void setStatusBarTintEnabled(boolean enabled) {
mStatusBarTintEnabled = enabled;
if (mStatusBarAvailable) {
mStatusBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE);
}
} | java | public void setStatusBarTintEnabled(boolean enabled) {
mStatusBarTintEnabled = enabled;
if (mStatusBarAvailable) {
mStatusBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE);
}
} | [
"public",
"void",
"setStatusBarTintEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"mStatusBarTintEnabled",
"=",
"enabled",
";",
"if",
"(",
"mStatusBarAvailable",
")",
"{",
"mStatusBarTintView",
".",
"setVisibility",
"(",
"enabled",
"?",
"View",
".",
"VISIBLE",
":"... | Enable tinting of the system status bar.
If the platform is running Jelly Bean or earlier, or translucent system
UI modes have not been enabled in either the theme or via window flags,
then this method does nothing.
@param enabled True to enable tinting, false to disable it (default). | [
"Enable",
"tinting",
"of",
"the",
"system",
"status",
"bar",
"."
] | daa0796a488b5480ef808aa6363d300675b4af83 | https://github.com/jgilfelt/SystemBarTint/blob/daa0796a488b5480ef808aa6363d300675b4af83/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java#L140-L145 |
59,110 | jgilfelt/SystemBarTint | library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java | SystemBarTintManager.setNavigationBarTintEnabled | public void setNavigationBarTintEnabled(boolean enabled) {
mNavBarTintEnabled = enabled;
if (mNavBarAvailable) {
mNavBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE);
}
} | java | public void setNavigationBarTintEnabled(boolean enabled) {
mNavBarTintEnabled = enabled;
if (mNavBarAvailable) {
mNavBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE);
}
} | [
"public",
"void",
"setNavigationBarTintEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"mNavBarTintEnabled",
"=",
"enabled",
";",
"if",
"(",
"mNavBarAvailable",
")",
"{",
"mNavBarTintView",
".",
"setVisibility",
"(",
"enabled",
"?",
"View",
".",
"VISIBLE",
":",
"... | Enable tinting of the system navigation bar.
If the platform does not have soft navigation keys, is running Jelly Bean
or earlier, or translucent system UI modes have not been enabled in either
the theme or via window flags, then this method does nothing.
@param enabled True to enable tinting, false to disable it (de... | [
"Enable",
"tinting",
"of",
"the",
"system",
"navigation",
"bar",
"."
] | daa0796a488b5480ef808aa6363d300675b4af83 | https://github.com/jgilfelt/SystemBarTint/blob/daa0796a488b5480ef808aa6363d300675b4af83/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java#L156-L161 |
59,111 | jgilfelt/SystemBarTint | library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java | SystemBarTintManager.setStatusBarAlpha | @TargetApi(11)
public void setStatusBarAlpha(float alpha) {
if (mStatusBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mStatusBarTintView.setAlpha(alpha);
}
} | java | @TargetApi(11)
public void setStatusBarAlpha(float alpha) {
if (mStatusBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mStatusBarTintView.setAlpha(alpha);
}
} | [
"@",
"TargetApi",
"(",
"11",
")",
"public",
"void",
"setStatusBarAlpha",
"(",
"float",
"alpha",
")",
"{",
"if",
"(",
"mStatusBarAvailable",
"&&",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"{",
"mSt... | Apply the specified alpha to the system status bar.
@param alpha The alpha to use | [
"Apply",
"the",
"specified",
"alpha",
"to",
"the",
"system",
"status",
"bar",
"."
] | daa0796a488b5480ef808aa6363d300675b4af83 | https://github.com/jgilfelt/SystemBarTint/blob/daa0796a488b5480ef808aa6363d300675b4af83/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java#L242-L247 |
59,112 | jgilfelt/SystemBarTint | library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java | SystemBarTintManager.setNavigationBarAlpha | @TargetApi(11)
public void setNavigationBarAlpha(float alpha) {
if (mNavBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mNavBarTintView.setAlpha(alpha);
}
} | java | @TargetApi(11)
public void setNavigationBarAlpha(float alpha) {
if (mNavBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mNavBarTintView.setAlpha(alpha);
}
} | [
"@",
"TargetApi",
"(",
"11",
")",
"public",
"void",
"setNavigationBarAlpha",
"(",
"float",
"alpha",
")",
"{",
"if",
"(",
"mNavBarAvailable",
"&&",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"{",
"mN... | Apply the specified alpha to the system navigation bar.
@param alpha The alpha to use | [
"Apply",
"the",
"specified",
"alpha",
"to",
"the",
"system",
"navigation",
"bar",
"."
] | daa0796a488b5480ef808aa6363d300675b4af83 | https://github.com/jgilfelt/SystemBarTint/blob/daa0796a488b5480ef808aa6363d300675b4af83/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java#L288-L293 |
59,113 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/ShoppingCart.java | ShoppingCart.addProduct | public Completable addProduct(Product product) {
List<Product> updatedShoppingCart = new ArrayList<>();
updatedShoppingCart.addAll(itemsInShoppingCart.getValue());
updatedShoppingCart.add(product);
itemsInShoppingCart.onNext(updatedShoppingCart);
return Completable.complete();
} | java | public Completable addProduct(Product product) {
List<Product> updatedShoppingCart = new ArrayList<>();
updatedShoppingCart.addAll(itemsInShoppingCart.getValue());
updatedShoppingCart.add(product);
itemsInShoppingCart.onNext(updatedShoppingCart);
return Completable.complete();
} | [
"public",
"Completable",
"addProduct",
"(",
"Product",
"product",
")",
"{",
"List",
"<",
"Product",
">",
"updatedShoppingCart",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"updatedShoppingCart",
".",
"addAll",
"(",
"itemsInShoppingCart",
".",
"getValue",
"(",
... | Adds a product to the shopping cart | [
"Adds",
"a",
"product",
"to",
"the",
"shopping",
"cart"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/ShoppingCart.java#L47-L53 |
59,114 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/ShoppingCart.java | ShoppingCart.removeProduct | public Completable removeProduct(Product product) {
List<Product> updatedShoppingCart = new ArrayList<>();
updatedShoppingCart.addAll(itemsInShoppingCart.getValue());
updatedShoppingCart.remove(product);
itemsInShoppingCart.onNext(updatedShoppingCart);
return Completable.complete();
} | java | public Completable removeProduct(Product product) {
List<Product> updatedShoppingCart = new ArrayList<>();
updatedShoppingCart.addAll(itemsInShoppingCart.getValue());
updatedShoppingCart.remove(product);
itemsInShoppingCart.onNext(updatedShoppingCart);
return Completable.complete();
} | [
"public",
"Completable",
"removeProduct",
"(",
"Product",
"product",
")",
"{",
"List",
"<",
"Product",
">",
"updatedShoppingCart",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"updatedShoppingCart",
".",
"addAll",
"(",
"itemsInShoppingCart",
".",
"getValue",
"(... | Remove a product to the shopping cart | [
"Remove",
"a",
"product",
"to",
"the",
"shopping",
"cart"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/ShoppingCart.java#L58-L64 |
59,115 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/ShoppingCart.java | ShoppingCart.removeProducts | public Completable removeProducts(List<Product> products) {
List<Product> updatedShoppingCart = new ArrayList<>();
updatedShoppingCart.addAll(itemsInShoppingCart.getValue());
updatedShoppingCart.removeAll(products);
itemsInShoppingCart.onNext(updatedShoppingCart);
return Completable.complete();
} | java | public Completable removeProducts(List<Product> products) {
List<Product> updatedShoppingCart = new ArrayList<>();
updatedShoppingCart.addAll(itemsInShoppingCart.getValue());
updatedShoppingCart.removeAll(products);
itemsInShoppingCart.onNext(updatedShoppingCart);
return Completable.complete();
} | [
"public",
"Completable",
"removeProducts",
"(",
"List",
"<",
"Product",
">",
"products",
")",
"{",
"List",
"<",
"Product",
">",
"updatedShoppingCart",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"updatedShoppingCart",
".",
"addAll",
"(",
"itemsInShoppingCart",... | Remove a list of Products from the shopping cart | [
"Remove",
"a",
"list",
"of",
"Products",
"from",
"the",
"shopping",
"cart"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/ShoppingCart.java#L69-L75 |
59,116 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/base/presenter/BaseRxLcePresenter.java | BaseRxLcePresenter.subscribe | public void subscribe(Observable<M> observable, final boolean pullToRefresh) {
if (isViewAttached()) {
getView().showLoading(pullToRefresh);
}
unsubscribe();
subscriber = new Subscriber<M>() {
private boolean ptr = pullToRefresh;
@Override public void onCompleted() {
BaseRx... | java | public void subscribe(Observable<M> observable, final boolean pullToRefresh) {
if (isViewAttached()) {
getView().showLoading(pullToRefresh);
}
unsubscribe();
subscriber = new Subscriber<M>() {
private boolean ptr = pullToRefresh;
@Override public void onCompleted() {
BaseRx... | [
"public",
"void",
"subscribe",
"(",
"Observable",
"<",
"M",
">",
"observable",
",",
"final",
"boolean",
"pullToRefresh",
")",
"{",
"if",
"(",
"isViewAttached",
"(",
")",
")",
"{",
"getView",
"(",
")",
".",
"showLoading",
"(",
"pullToRefresh",
")",
";",
"... | Subscribes the presenter himself as subscriber on the observable
@param observable The observable to subscribe
@param pullToRefresh Pull to refresh? | [
"Subscribes",
"the",
"presenter",
"himself",
"as",
"subscriber",
"on",
"the",
"observable"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/base/presenter/BaseRxLcePresenter.java#L60-L87 |
59,117 | sockeqwe/mosby | mvp/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpActivity.java | MvpActivity.getMvpDelegate | @NonNull protected ActivityMvpDelegate<V, P> getMvpDelegate() {
if (mvpDelegate == null) {
mvpDelegate = new ActivityMvpDelegateImpl(this, this, true);
}
return mvpDelegate;
} | java | @NonNull protected ActivityMvpDelegate<V, P> getMvpDelegate() {
if (mvpDelegate == null) {
mvpDelegate = new ActivityMvpDelegateImpl(this, this, true);
}
return mvpDelegate;
} | [
"@",
"NonNull",
"protected",
"ActivityMvpDelegate",
"<",
"V",
",",
"P",
">",
"getMvpDelegate",
"(",
")",
"{",
"if",
"(",
"mvpDelegate",
"==",
"null",
")",
"{",
"mvpDelegate",
"=",
"new",
"ActivityMvpDelegateImpl",
"(",
"this",
",",
"this",
",",
"true",
")"... | Get the mvp delegate. This is internally used for creating presenter, attaching and detaching
view from presenter.
<p><b>Please note that only one instance of mvp delegate should be used per Activity
instance</b>.
</p>
<p>
Only override this method if you really know what you are doing.
</p>
@return {@link ActivityM... | [
"Get",
"the",
"mvp",
"delegate",
".",
"This",
"is",
"internally",
"used",
"for",
"creating",
"presenter",
"attaching",
"and",
"detaching",
"view",
"from",
"presenter",
"."
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvp/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpActivity.java#L111-L117 |
59,118 | sockeqwe/mosby | mvi-common/src/main/java/com/hannesdorfmann/mosby3/mvi/MviBasePresenter.java | MviBasePresenter.subscribeViewStateConsumerActually | @MainThread
private void subscribeViewStateConsumerActually(@NonNull final V view) {
if (view == null) {
throw new NullPointerException("View is null");
}
if (viewStateConsumer == null) {
throw new NullPointerException(ViewStateConsumer.class.getSimpleName()
... | java | @MainThread
private void subscribeViewStateConsumerActually(@NonNull final V view) {
if (view == null) {
throw new NullPointerException("View is null");
}
if (viewStateConsumer == null) {
throw new NullPointerException(ViewStateConsumer.class.getSimpleName()
... | [
"@",
"MainThread",
"private",
"void",
"subscribeViewStateConsumerActually",
"(",
"@",
"NonNull",
"final",
"V",
"view",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"View is null\"",
")",
";",
"}",
"if",
... | Actually subscribes the view as consumer to the internally view relay.
@param view The mvp view | [
"Actually",
"subscribes",
"the",
"view",
"as",
"consumer",
"to",
"the",
"internally",
"view",
"relay",
"."
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvi-common/src/main/java/com/hannesdorfmann/mosby3/mvi/MviBasePresenter.java#L375-L393 |
59,119 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/account/DefaultAccountManager.java | DefaultAccountManager.doLogin | @Override public Observable<Account> doLogin(AuthCredentials credentials) {
return Observable.just(credentials).flatMap(new Func1<AuthCredentials, Observable<Account>>() {
@Override public Observable<Account> call(AuthCredentials credentials) {
try {
// Simulate network delay
Thr... | java | @Override public Observable<Account> doLogin(AuthCredentials credentials) {
return Observable.just(credentials).flatMap(new Func1<AuthCredentials, Observable<Account>>() {
@Override public Observable<Account> call(AuthCredentials credentials) {
try {
// Simulate network delay
Thr... | [
"@",
"Override",
"public",
"Observable",
"<",
"Account",
">",
"doLogin",
"(",
"AuthCredentials",
"credentials",
")",
"{",
"return",
"Observable",
".",
"just",
"(",
"credentials",
")",
".",
"flatMap",
"(",
"new",
"Func1",
"<",
"AuthCredentials",
",",
"Observabl... | Returns the Account observable | [
"Returns",
"the",
"Account",
"observable"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/account/DefaultAccountManager.java#L32-L52 |
59,120 | sockeqwe/mosby | mvp-lce/src/main/java/com/hannesdorfmann/mosby3/mvp/lce/LceAnimator.java | LceAnimator.showErrorView | public static void showErrorView(@NonNull final View loadingView, @NonNull final View contentView,
final View errorView) {
contentView.setVisibility(View.GONE);
final Resources resources = loadingView.getResources();
// Not visible yet, so animate the view in
AnimatorSet set = new AnimatorSet();... | java | public static void showErrorView(@NonNull final View loadingView, @NonNull final View contentView,
final View errorView) {
contentView.setVisibility(View.GONE);
final Resources resources = loadingView.getResources();
// Not visible yet, so animate the view in
AnimatorSet set = new AnimatorSet();... | [
"public",
"static",
"void",
"showErrorView",
"(",
"@",
"NonNull",
"final",
"View",
"loadingView",
",",
"@",
"NonNull",
"final",
"View",
"contentView",
",",
"final",
"View",
"errorView",
")",
"{",
"contentView",
".",
"setVisibility",
"(",
"View",
".",
"GONE",
... | Shows the error view instead of the loading view | [
"Shows",
"the",
"error",
"view",
"instead",
"of",
"the",
"loading",
"view"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvp-lce/src/main/java/com/hannesdorfmann/mosby3/mvp/lce/LceAnimator.java#L53-L82 |
59,121 | sockeqwe/mosby | mvp-lce/src/main/java/com/hannesdorfmann/mosby3/mvp/lce/LceAnimator.java | LceAnimator.showContent | public static void showContent(@NonNull final View loadingView, @NonNull final View contentView,
@NonNull final View errorView) {
if (contentView.getVisibility() == View.VISIBLE) {
// No Changing needed, because contentView is already visible
errorView.setVisibility(View.GONE);
loadingView.... | java | public static void showContent(@NonNull final View loadingView, @NonNull final View contentView,
@NonNull final View errorView) {
if (contentView.getVisibility() == View.VISIBLE) {
// No Changing needed, because contentView is already visible
errorView.setVisibility(View.GONE);
loadingView.... | [
"public",
"static",
"void",
"showContent",
"(",
"@",
"NonNull",
"final",
"View",
"loadingView",
",",
"@",
"NonNull",
"final",
"View",
"contentView",
",",
"@",
"NonNull",
"final",
"View",
"errorView",
")",
"{",
"if",
"(",
"contentView",
".",
"getVisibility",
... | Display the content instead of the loadingView | [
"Display",
"the",
"content",
"instead",
"of",
"the",
"loadingView"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvp-lce/src/main/java/com/hannesdorfmann/mosby3/mvp/lce/LceAnimator.java#L87-L131 |
59,122 | sockeqwe/mosby | mvp-nullobject-presenter/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpNullObjectBasePresenter.java | MvpNullObjectBasePresenter.isSubTypeOfMvpView | private boolean isSubTypeOfMvpView(Class<?> klass) {
if (klass.equals(MvpView.class)) {
return true;
}
Class[] superInterfaces = klass.getInterfaces();
for (int i = 0; i < superInterfaces.length; i++) {
if (isSubTypeOfMvpView(superInterfaces[i])) {
return true;
}
}
retu... | java | private boolean isSubTypeOfMvpView(Class<?> klass) {
if (klass.equals(MvpView.class)) {
return true;
}
Class[] superInterfaces = klass.getInterfaces();
for (int i = 0; i < superInterfaces.length; i++) {
if (isSubTypeOfMvpView(superInterfaces[i])) {
return true;
}
}
retu... | [
"private",
"boolean",
"isSubTypeOfMvpView",
"(",
"Class",
"<",
"?",
">",
"klass",
")",
"{",
"if",
"(",
"klass",
".",
"equals",
"(",
"MvpView",
".",
"class",
")",
")",
"{",
"return",
"true",
";",
"}",
"Class",
"[",
"]",
"superInterfaces",
"=",
"klass",
... | Scans the interface inheritance hierarchy and checks if on the root is MvpView.class
@param klass The leaf interface where to begin to scan
@return true if subtype of MvpView, otherwise false | [
"Scans",
"the",
"interface",
"inheritance",
"hierarchy",
"and",
"checks",
"if",
"on",
"the",
"root",
"is",
"MvpView",
".",
"class"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvp-nullobject-presenter/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpNullObjectBasePresenter.java#L85-L96 |
59,123 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java | DimensUtils.dpToPx | public static int dpToPx(Context context, float dp) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) ((dp * displayMetrics.density) + 0.5);
} | java | public static int dpToPx(Context context, float dp) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) ((dp * displayMetrics.density) + 0.5);
} | [
"public",
"static",
"int",
"dpToPx",
"(",
"Context",
"context",
",",
"float",
"dp",
")",
"{",
"DisplayMetrics",
"displayMetrics",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
";",
"return",
"(",
"int",
")",
"(",
"(",
... | Converts a dp value to a px value
@param context The context
@param dp the dp value
@return value in pixels | [
"Converts",
"a",
"dp",
"value",
"to",
"a",
"px",
"value"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java#L21-L24 |
59,124 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java | DimensUtils.pxToDp | public static int pxToDp(Context context, int px) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) ((px / displayMetrics.density) + 0.5);
} | java | public static int pxToDp(Context context, int px) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) ((px / displayMetrics.density) + 0.5);
} | [
"public",
"static",
"int",
"pxToDp",
"(",
"Context",
"context",
",",
"int",
"px",
")",
"{",
"DisplayMetrics",
"displayMetrics",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
";",
"return",
"(",
"int",
")",
"(",
"(",
"... | Converts pixel in dp
@param context The context
@param px the pixel value
@return value in dp | [
"Converts",
"pixel",
"in",
"dp"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java#L33-L36 |
59,125 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java | DimensUtils.pxToSp | public static float pxToSp(Context context, Float px) {
float scaledDensity = context.getResources().getDisplayMetrics().scaledDensity;
return px / scaledDensity;
} | java | public static float pxToSp(Context context, Float px) {
float scaledDensity = context.getResources().getDisplayMetrics().scaledDensity;
return px / scaledDensity;
} | [
"public",
"static",
"float",
"pxToSp",
"(",
"Context",
"context",
",",
"Float",
"px",
")",
"{",
"float",
"scaledDensity",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
".",
"scaledDensity",
";",
"return",
"px",
"/",
"sc... | Convertes pixels to sp | [
"Convertes",
"pixels",
"to",
"sp"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java#L41-L44 |
59,126 | sockeqwe/mosby | viewstate/src/main/java/com/hannesdorfmann/mosby3/mvp/delegate/FragmentMvpViewStateDelegateImpl.java | FragmentMvpViewStateDelegateImpl.restorePresenterOrRecreateNewPresenterAfterProcessDeath | private P restorePresenterOrRecreateNewPresenterAfterProcessDeath() {
P presenter;
if (keepPresenterInstanceDuringScreenOrientationChanges) {
if (mosbyViewId != null
&& (presenter = PresenterManager.getPresenter(getActivity(), mosbyViewId)) != null) {
//
// Presenter restored ... | java | private P restorePresenterOrRecreateNewPresenterAfterProcessDeath() {
P presenter;
if (keepPresenterInstanceDuringScreenOrientationChanges) {
if (mosbyViewId != null
&& (presenter = PresenterManager.getPresenter(getActivity(), mosbyViewId)) != null) {
//
// Presenter restored ... | [
"private",
"P",
"restorePresenterOrRecreateNewPresenterAfterProcessDeath",
"(",
")",
"{",
"P",
"presenter",
";",
"if",
"(",
"keepPresenterInstanceDuringScreenOrientationChanges",
")",
"{",
"if",
"(",
"mosbyViewId",
"!=",
"null",
"&&",
"(",
"presenter",
"=",
"PresenterMa... | Creates the presenter instance if not able to reuse presenter from PresenterManager | [
"Creates",
"the",
"presenter",
"instance",
"if",
"not",
"able",
"to",
"reuse",
"presenter",
"from",
"PresenterManager"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/viewstate/src/main/java/com/hannesdorfmann/mosby3/mvp/delegate/FragmentMvpViewStateDelegateImpl.java#L279-L323 |
59,127 | sockeqwe/mosby | viewstate/src/main/java/com/hannesdorfmann/mosby3/mvp/delegate/FragmentMvpViewStateDelegateImpl.java | FragmentMvpViewStateDelegateImpl.createViewState | private VS createViewState() {
VS viewState = delegateCallback.createViewState();
if (viewState == null) {
throw new NullPointerException(
"ViewState returned from createViewState() is null. Fragment is " + fragment);
}
if (keepPresenterInstanceDuringScreenOrientationChanges) {
Pr... | java | private VS createViewState() {
VS viewState = delegateCallback.createViewState();
if (viewState == null) {
throw new NullPointerException(
"ViewState returned from createViewState() is null. Fragment is " + fragment);
}
if (keepPresenterInstanceDuringScreenOrientationChanges) {
Pr... | [
"private",
"VS",
"createViewState",
"(",
")",
"{",
"VS",
"viewState",
"=",
"delegateCallback",
".",
"createViewState",
"(",
")",
";",
"if",
"(",
"viewState",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"ViewState returned from createView... | Creates a new ViewState instance
@return the newly created instance | [
"Creates",
"a",
"new",
"ViewState",
"instance"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/viewstate/src/main/java/com/hannesdorfmann/mosby3/mvp/delegate/FragmentMvpViewStateDelegateImpl.java#L363-L375 |
59,128 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/interactor/details/DetailsInteractor.java | DetailsInteractor.getDetails | public Observable<ProductDetailsViewState> getDetails(int productId) {
return getProductWithShoppingCartInfo(productId)
.subscribeOn(Schedulers.io())
.map(ProductDetailsViewState.DataState::new)
.cast(ProductDetailsViewState.class)
.startWith(new ProductDetailsViewState.LoadingState(... | java | public Observable<ProductDetailsViewState> getDetails(int productId) {
return getProductWithShoppingCartInfo(productId)
.subscribeOn(Schedulers.io())
.map(ProductDetailsViewState.DataState::new)
.cast(ProductDetailsViewState.class)
.startWith(new ProductDetailsViewState.LoadingState(... | [
"public",
"Observable",
"<",
"ProductDetailsViewState",
">",
"getDetails",
"(",
"int",
"productId",
")",
"{",
"return",
"getProductWithShoppingCartInfo",
"(",
"productId",
")",
".",
"subscribeOn",
"(",
"Schedulers",
".",
"io",
"(",
")",
")",
".",
"map",
"(",
"... | Get the details of a given product | [
"Get",
"the",
"details",
"of",
"a",
"given",
"product"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/interactor/details/DetailsInteractor.java#L67-L74 |
59,129 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java | ProductBackendApiDecorator.getAllProducts | public Observable<List<Product>> getAllProducts() {
return Observable.zip(getProducts(0), getProducts(1), getProducts(2), getProducts(3),
(products0, products1, products2, products3) -> {
List<Product> productList = new ArrayList<Product>();
productList.addAll(products0);
produ... | java | public Observable<List<Product>> getAllProducts() {
return Observable.zip(getProducts(0), getProducts(1), getProducts(2), getProducts(3),
(products0, products1, products2, products3) -> {
List<Product> productList = new ArrayList<Product>();
productList.addAll(products0);
produ... | [
"public",
"Observable",
"<",
"List",
"<",
"Product",
">",
">",
"getAllProducts",
"(",
")",
"{",
"return",
"Observable",
".",
"zip",
"(",
"getProducts",
"(",
"0",
")",
",",
"getProducts",
"(",
"1",
")",
",",
"getProducts",
"(",
"2",
")",
",",
"getProduc... | Get a list with all products from backend | [
"Get",
"a",
"list",
"with",
"all",
"products",
"from",
"backend"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java#L52-L62 |
59,130 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java | ProductBackendApiDecorator.getAllProductsOfCategory | public Observable<List<Product>> getAllProductsOfCategory(String categoryName) {
return getAllProducts().flatMap(Observable::fromIterable)
.filter(product -> product.getCategory().equals(categoryName))
.toList()
.toObservable();
} | java | public Observable<List<Product>> getAllProductsOfCategory(String categoryName) {
return getAllProducts().flatMap(Observable::fromIterable)
.filter(product -> product.getCategory().equals(categoryName))
.toList()
.toObservable();
} | [
"public",
"Observable",
"<",
"List",
"<",
"Product",
">",
">",
"getAllProductsOfCategory",
"(",
"String",
"categoryName",
")",
"{",
"return",
"getAllProducts",
"(",
")",
".",
"flatMap",
"(",
"Observable",
"::",
"fromIterable",
")",
".",
"filter",
"(",
"product... | Get all products of a certain category
@param categoryName The name of the category | [
"Get",
"all",
"products",
"of",
"a",
"certain",
"category"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java#L69-L74 |
59,131 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java | ProductBackendApiDecorator.getAllCategories | public Observable<List<String>> getAllCategories() {
return getAllProducts().map(products -> {
Set<String> categories = new HashSet<String>();
for (Product p : products) {
categories.add(p.getCategory());
}
List<String> result = new ArrayList<String>(categories.size());
result... | java | public Observable<List<String>> getAllCategories() {
return getAllProducts().map(products -> {
Set<String> categories = new HashSet<String>();
for (Product p : products) {
categories.add(p.getCategory());
}
List<String> result = new ArrayList<String>(categories.size());
result... | [
"public",
"Observable",
"<",
"List",
"<",
"String",
">",
">",
"getAllCategories",
"(",
")",
"{",
"return",
"getAllProducts",
"(",
")",
".",
"map",
"(",
"products",
"->",
"{",
"Set",
"<",
"String",
">",
"categories",
"=",
"new",
"HashSet",
"<",
"String",
... | Get a list with all categories | [
"Get",
"a",
"list",
"with",
"all",
"categories"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java#L79-L90 |
59,132 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java | ProductBackendApiDecorator.getProduct | public Observable<Product> getProduct(int productId) {
return getAllProducts().flatMap(products -> Observable.fromIterable(products))
.filter(product -> product.getId() == productId)
.take(1);
} | java | public Observable<Product> getProduct(int productId) {
return getAllProducts().flatMap(products -> Observable.fromIterable(products))
.filter(product -> product.getId() == productId)
.take(1);
} | [
"public",
"Observable",
"<",
"Product",
">",
"getProduct",
"(",
"int",
"productId",
")",
"{",
"return",
"getAllProducts",
"(",
")",
".",
"flatMap",
"(",
"products",
"->",
"Observable",
".",
"fromIterable",
"(",
"products",
")",
")",
".",
"filter",
"(",
"pr... | Get the product with the given id
@param productId The product id | [
"Get",
"the",
"product",
"with",
"the",
"given",
"id"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java#L97-L101 |
59,133 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/feed/HomeFeedLoader.java | HomeFeedLoader.loadProductsOfCategory | public Observable<List<Product>> loadProductsOfCategory(String categoryName) {
return backendApi.getAllProductsOfCategory(categoryName).delay(3, TimeUnit.SECONDS);
} | java | public Observable<List<Product>> loadProductsOfCategory(String categoryName) {
return backendApi.getAllProductsOfCategory(categoryName).delay(3, TimeUnit.SECONDS);
} | [
"public",
"Observable",
"<",
"List",
"<",
"Product",
">",
">",
"loadProductsOfCategory",
"(",
"String",
"categoryName",
")",
"{",
"return",
"backendApi",
".",
"getAllProductsOfCategory",
"(",
"categoryName",
")",
".",
"delay",
"(",
"3",
",",
"TimeUnit",
".",
"... | Loads all items of a given category
@param categoryName the category name | [
"Loads",
"all",
"items",
"of",
"a",
"given",
"category"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/feed/HomeFeedLoader.java#L68-L70 |
59,134 | sockeqwe/mosby | mvp-queuing-presenter/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpQueuingBasePresenter.java | MvpQueuingBasePresenter.runQueuedActions | private void runQueuedActions() {
V view = viewRef == null ? null : viewRef.get();
if (view != null) {
while (!viewActionQueue.isEmpty()) {
ViewAction<V> action = viewActionQueue.poll();
action.run(view);
}
}
} | java | private void runQueuedActions() {
V view = viewRef == null ? null : viewRef.get();
if (view != null) {
while (!viewActionQueue.isEmpty()) {
ViewAction<V> action = viewActionQueue.poll();
action.run(view);
}
}
} | [
"private",
"void",
"runQueuedActions",
"(",
")",
"{",
"V",
"view",
"=",
"viewRef",
"==",
"null",
"?",
"null",
":",
"viewRef",
".",
"get",
"(",
")",
";",
"if",
"(",
"view",
"!=",
"null",
")",
"{",
"while",
"(",
"!",
"viewActionQueue",
".",
"isEmpty",
... | Runs the queued actions. | [
"Runs",
"the",
"queued",
"actions",
"."
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvp-queuing-presenter/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpQueuingBasePresenter.java#L108-L116 |
59,135 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/KeyboardUtils.java | KeyboardUtils.hideKeyboard | public static boolean hideKeyboard(View view) {
if (view == null) {
throw new NullPointerException("View is null!");
}
try {
InputMethodManager imm =
(InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm == null) {
return false;... | java | public static boolean hideKeyboard(View view) {
if (view == null) {
throw new NullPointerException("View is null!");
}
try {
InputMethodManager imm =
(InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm == null) {
return false;... | [
"public",
"static",
"boolean",
"hideKeyboard",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"View is null!\"",
")",
";",
"}",
"try",
"{",
"InputMethodManager",
"imm",
"=",
"(",
"In... | Hides the soft keyboard from screen
@param view Usually the EditText, but in dynamically layouts you should pass the layout
instead of the EditText
@return true, if keyboard has been hidden, otherwise false (i.e. the keyboard was not displayed
on the screen or no Softkeyboard because device has hardware keyboard) | [
"Hides",
"the",
"soft",
"keyboard",
"from",
"screen"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/KeyboardUtils.java#L33-L53 |
59,136 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/interactor/search/SearchInteractor.java | SearchInteractor.search | public Observable<SearchViewState> search(String searchString) {
// Empty String, so no search
if (searchString.isEmpty()) {
return Observable.just(new SearchViewState.SearchNotStartedYet());
}
// search for product
return searchEngine.searchFor(searchString)
.map(products -> {
... | java | public Observable<SearchViewState> search(String searchString) {
// Empty String, so no search
if (searchString.isEmpty()) {
return Observable.just(new SearchViewState.SearchNotStartedYet());
}
// search for product
return searchEngine.searchFor(searchString)
.map(products -> {
... | [
"public",
"Observable",
"<",
"SearchViewState",
">",
"search",
"(",
"String",
"searchString",
")",
"{",
"// Empty String, so no search",
"if",
"(",
"searchString",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"Observable",
".",
"just",
"(",
"new",
"SearchViewSt... | Search for items | [
"Search",
"for",
"items"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/interactor/search/SearchInteractor.java#L38-L55 |
59,137 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java | MailProvider.getLabels | public Observable<List<Label>> getLabels() {
return Observable.just(mails).flatMap(new Func1<List<Mail>, Observable<List<Label>>>() {
@Override public Observable<List<Label>> call(List<Mail> mails) {
delay();
Observable error = checkExceptions();
if (error != null) {
return... | java | public Observable<List<Label>> getLabels() {
return Observable.just(mails).flatMap(new Func1<List<Mail>, Observable<List<Label>>>() {
@Override public Observable<List<Label>> call(List<Mail> mails) {
delay();
Observable error = checkExceptions();
if (error != null) {
return... | [
"public",
"Observable",
"<",
"List",
"<",
"Label",
">",
">",
"getLabels",
"(",
")",
"{",
"return",
"Observable",
".",
"just",
"(",
"mails",
")",
".",
"flatMap",
"(",
"new",
"Func1",
"<",
"List",
"<",
"Mail",
">",
",",
"Observable",
"<",
"List",
"<",
... | Get the labels with the number of unread mails. | [
"Get",
"the",
"labels",
"with",
"the",
"number",
"of",
"unread",
"mails",
"."
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java#L63-L118 |
59,138 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java | MailProvider.getMailsOfLabel | public Observable<List<Mail>> getMailsOfLabel(final String l) {
return getFilteredMailList(new Func1<Mail, Boolean>() {
@Override public Boolean call(Mail mail) {
return mail.getLabel().equals(l);
}
});
} | java | public Observable<List<Mail>> getMailsOfLabel(final String l) {
return getFilteredMailList(new Func1<Mail, Boolean>() {
@Override public Boolean call(Mail mail) {
return mail.getLabel().equals(l);
}
});
} | [
"public",
"Observable",
"<",
"List",
"<",
"Mail",
">",
">",
"getMailsOfLabel",
"(",
"final",
"String",
"l",
")",
"{",
"return",
"getFilteredMailList",
"(",
"new",
"Func1",
"<",
"Mail",
",",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boole... | Get a list of mails with the given label | [
"Get",
"a",
"list",
"of",
"mails",
"with",
"the",
"given",
"label"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java#L140-L147 |
59,139 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java | MailProvider.starMail | public Observable<Mail> starMail(int mailId, final boolean star) {
return getMail(mailId).map(new Func1<Mail, Mail>() {
@Override public Mail call(Mail mail) {
mail.setStarred(star);
return mail;
}
});
} | java | public Observable<Mail> starMail(int mailId, final boolean star) {
return getMail(mailId).map(new Func1<Mail, Mail>() {
@Override public Mail call(Mail mail) {
mail.setStarred(star);
return mail;
}
});
} | [
"public",
"Observable",
"<",
"Mail",
">",
"starMail",
"(",
"int",
"mailId",
",",
"final",
"boolean",
"star",
")",
"{",
"return",
"getMail",
"(",
"mailId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"Mail",
",",
"Mail",
">",
"(",
")",
"{",
"@",
"Ove... | Star or unstar a mail
@param mailId the id of the mail
@param star true, if you want to star, false if you want to unstar | [
"Star",
"or",
"unstar",
"a",
"mail"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java#L177-L185 |
59,140 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java | MailProvider.addMailWithDelay | public Observable<Mail> addMailWithDelay(final Mail mail) {
return Observable.defer(new Func0<Observable<Mail>>() {
@Override public Observable<Mail> call() {
delay();
Observable o = checkExceptions();
if (o != null) {
return o;
}
return Observable.just(mail)... | java | public Observable<Mail> addMailWithDelay(final Mail mail) {
return Observable.defer(new Func0<Observable<Mail>>() {
@Override public Observable<Mail> call() {
delay();
Observable o = checkExceptions();
if (o != null) {
return o;
}
return Observable.just(mail)... | [
"public",
"Observable",
"<",
"Mail",
">",
"addMailWithDelay",
"(",
"final",
"Mail",
"mail",
")",
"{",
"return",
"Observable",
".",
"defer",
"(",
"new",
"Func0",
"<",
"Observable",
"<",
"Mail",
">",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Observab... | Creates and saves a new mail | [
"Creates",
"and",
"saves",
"a",
"new",
"mail"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java#L190-L206 |
59,141 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java | MailProvider.getFilteredMailList | private Observable<List<Mail>> getFilteredMailList(Func1<Mail, Boolean> filterFnc,
final boolean withDelayAndError) {
return Observable.defer(new Func0<Observable<Mail>>() {
@Override public Observable<Mail> call() {
if (withDelayAndError) {
delay();
Observable o = checkExce... | java | private Observable<List<Mail>> getFilteredMailList(Func1<Mail, Boolean> filterFnc,
final boolean withDelayAndError) {
return Observable.defer(new Func0<Observable<Mail>>() {
@Override public Observable<Mail> call() {
if (withDelayAndError) {
delay();
Observable o = checkExce... | [
"private",
"Observable",
"<",
"List",
"<",
"Mail",
">",
">",
"getFilteredMailList",
"(",
"Func1",
"<",
"Mail",
",",
"Boolean",
">",
"filterFnc",
",",
"final",
"boolean",
"withDelayAndError",
")",
"{",
"return",
"Observable",
".",
"defer",
"(",
"new",
"Func0"... | Filters the list of mails by the given criteria | [
"Filters",
"the",
"list",
"of",
"mails",
"by",
"the",
"given",
"criteria"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/model/mail/MailProvider.java#L305-L334 |
59,142 | sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/mails/MailsAdapter.java | MailsAdapter.findMail | public Mail findMail(int id) {
if (items == null) {
return null;
}
for (Mail m : items) {
if (m.getId() == id) {
return m;
}
}
return null;
} | java | public Mail findMail(int id) {
if (items == null) {
return null;
}
for (Mail m : items) {
if (m.getId() == id) {
return m;
}
}
return null;
} | [
"public",
"Mail",
"findMail",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"items",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"Mail",
"m",
":",
"items",
")",
"{",
"if",
"(",
"m",
".",
"getId",
"(",
")",
"==",
"id",
")",
"{",
... | Finds a mail by his id if displayed in this adapter | [
"Finds",
"a",
"mail",
"by",
"his",
"id",
"if",
"displayed",
"in",
"this",
"adapter"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/mails/MailsAdapter.java#L120-L132 |
59,143 | sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/searchengine/SearchEngine.java | SearchEngine.isProductMatchingSearchCriteria | private boolean isProductMatchingSearchCriteria(Product product, String searchQueryText) {
String words[] = searchQueryText.split(" ");
for (String w : words) {
if (product.getName().contains(w)) return true;
if (product.getDescription().contains(w)) return true;
if (product.getCategory().cont... | java | private boolean isProductMatchingSearchCriteria(Product product, String searchQueryText) {
String words[] = searchQueryText.split(" ");
for (String w : words) {
if (product.getName().contains(w)) return true;
if (product.getDescription().contains(w)) return true;
if (product.getCategory().cont... | [
"private",
"boolean",
"isProductMatchingSearchCriteria",
"(",
"Product",
"product",
",",
"String",
"searchQueryText",
")",
"{",
"String",
"words",
"[",
"]",
"=",
"searchQueryText",
".",
"split",
"(",
"\" \"",
")",
";",
"for",
"(",
"String",
"w",
":",
"words",
... | Filters those items that contains the search query text in name, description or category | [
"Filters",
"those",
"items",
"that",
"contains",
"the",
"search",
"query",
"text",
"in",
"name",
"description",
"or",
"category"
] | 7f22118c950b5e6fbba0ec42d8e97586dfb08940 | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/searchengine/SearchEngine.java#L60-L68 |
59,144 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java | SharedProcessor.addAndStartListener | public void addAndStartListener(final ProcessorListener<ApiType> processorListener) {
lock.writeLock().lock();
try {
addListenerLocked(processorListener);
executorService.execute(processorListener);
} finally {
lock.writeLock().unlock();
}
} | java | public void addAndStartListener(final ProcessorListener<ApiType> processorListener) {
lock.writeLock().lock();
try {
addListenerLocked(processorListener);
executorService.execute(processorListener);
} finally {
lock.writeLock().unlock();
}
} | [
"public",
"void",
"addAndStartListener",
"(",
"final",
"ProcessorListener",
"<",
"ApiType",
">",
"processorListener",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"addListenerLocked",
"(",
"processorListener",
")",
";",... | addAndStartListener first adds the specific processorListener then starts the listener with
executor.
@param processorListener specific processor listener | [
"addAndStartListener",
"first",
"adds",
"the",
"specific",
"processorListener",
"then",
"starts",
"the",
"listener",
"with",
"executor",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java#L41-L50 |
59,145 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java | SharedProcessor.addListener | public void addListener(final ProcessorListener<ApiType> processorListener) {
lock.writeLock().lock();
try {
addListenerLocked(processorListener);
} finally {
lock.writeLock().unlock();
}
} | java | public void addListener(final ProcessorListener<ApiType> processorListener) {
lock.writeLock().lock();
try {
addListenerLocked(processorListener);
} finally {
lock.writeLock().unlock();
}
} | [
"public",
"void",
"addListener",
"(",
"final",
"ProcessorListener",
"<",
"ApiType",
">",
"processorListener",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"addListenerLocked",
"(",
"processorListener",
")",
";",
"}",
... | addListener adds the specific processorListener, but not start it.
@param processorListener specific processor listener | [
"addListener",
"adds",
"the",
"specific",
"processorListener",
"but",
"not",
"start",
"it",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java#L57-L64 |
59,146 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java | SharedProcessor.run | public void run() {
lock.readLock().lock();
try {
if (Collections.isEmptyCollection(listeners)) {
return;
}
for (ProcessorListener listener : listeners) {
executorService.execute(listener);
}
} finally {
lock.readLock().unlock();
}
} | java | public void run() {
lock.readLock().lock();
try {
if (Collections.isEmptyCollection(listeners)) {
return;
}
for (ProcessorListener listener : listeners) {
executorService.execute(listener);
}
} finally {
lock.readLock().unlock();
}
} | [
"public",
"void",
"run",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"Collections",
".",
"isEmptyCollection",
"(",
"listeners",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"ProcessorListener... | starts the processor listeners. | [
"starts",
"the",
"processor",
"listeners",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java#L72-L84 |
59,147 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java | SharedProcessor.distribute | public void distribute(ProcessorListener.Notification<ApiType> obj, boolean isSync) {
lock.readLock().lock();
try {
if (isSync) {
for (ProcessorListener<ApiType> listener : syncingListeners) {
listener.add(obj);
}
} else {
for (ProcessorListener<ApiType> listener : ... | java | public void distribute(ProcessorListener.Notification<ApiType> obj, boolean isSync) {
lock.readLock().lock();
try {
if (isSync) {
for (ProcessorListener<ApiType> listener : syncingListeners) {
listener.add(obj);
}
} else {
for (ProcessorListener<ApiType> listener : ... | [
"public",
"void",
"distribute",
"(",
"ProcessorListener",
".",
"Notification",
"<",
"ApiType",
">",
"obj",
",",
"boolean",
"isSync",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"isSync",
")",
"{",
"... | distribute the object among listeners.
@param obj specific obj
@param isSync is sync or not | [
"distribute",
"the",
"object",
"among",
"listeners",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java#L92-L107 |
59,148 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.setUsername | public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setUsername(username);
return;
}
}
throw new RuntimeException("No HTTP basic authe... | java | public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setUsername(username);
return;
}
}
throw new RuntimeException("No HTTP basic authe... | [
"public",
"void",
"setUsername",
"(",
"String",
"username",
")",
"{",
"for",
"(",
"Authentication",
"auth",
":",
"authentications",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"auth",
"instanceof",
"HttpBasicAuth",
")",
"{",
"(",
"(",
"HttpBasicAuth",
")... | Helper method to set username for the first HTTP basic authentication.
@param username Username | [
"Helper",
"method",
"to",
"set",
"username",
"for",
"the",
"first",
"HTTP",
"basic",
"authentication",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L277-L285 |
59,149 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.setPassword | public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setPassword(password);
return;
}
}
throw new RuntimeException("No HTTP basic authe... | java | public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setPassword(password);
return;
}
}
throw new RuntimeException("No HTTP basic authe... | [
"public",
"void",
"setPassword",
"(",
"String",
"password",
")",
"{",
"for",
"(",
"Authentication",
"auth",
":",
"authentications",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"auth",
"instanceof",
"HttpBasicAuth",
")",
"{",
"(",
"(",
"HttpBasicAuth",
")... | Helper method to set password for the first HTTP basic authentication.
@param password Password | [
"Helper",
"method",
"to",
"set",
"password",
"for",
"the",
"first",
"HTTP",
"basic",
"authentication",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L292-L300 |
59,150 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.setApiKey | public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return;
}
}
throw new RuntimeException("No API key authentication configu... | java | public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return;
}
}
throw new RuntimeException("No API key authentication configu... | [
"public",
"void",
"setApiKey",
"(",
"String",
"apiKey",
")",
"{",
"for",
"(",
"Authentication",
"auth",
":",
"authentications",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"auth",
"instanceof",
"ApiKeyAuth",
")",
"{",
"(",
"(",
"ApiKeyAuth",
")",
"auth... | Helper method to set API key value for the first API key authentication.
@param apiKey API key | [
"Helper",
"method",
"to",
"set",
"API",
"key",
"value",
"for",
"the",
"first",
"API",
"key",
"authentication",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L307-L315 |
59,151 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.setApiKeyPrefix | public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
return;
}
}
throw new RuntimeException("No API ke... | java | public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
return;
}
}
throw new RuntimeException("No API ke... | [
"public",
"void",
"setApiKeyPrefix",
"(",
"String",
"apiKeyPrefix",
")",
"{",
"for",
"(",
"Authentication",
"auth",
":",
"authentications",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"auth",
"instanceof",
"ApiKeyAuth",
")",
"{",
"(",
"(",
"ApiKeyAuth",
... | Helper method to set API key prefix for the first API key authentication.
@param apiKeyPrefix API key prefix | [
"Helper",
"method",
"to",
"set",
"API",
"key",
"prefix",
"for",
"the",
"first",
"API",
"key",
"authentication",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L322-L330 |
59,152 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.setAccessToken | public void setAccessToken(String accessToken) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).setAccessToken(accessToken);
return;
}
}
throw new RuntimeException("No OAuth2 authenticatio... | java | public void setAccessToken(String accessToken) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).setAccessToken(accessToken);
return;
}
}
throw new RuntimeException("No OAuth2 authenticatio... | [
"public",
"void",
"setAccessToken",
"(",
"String",
"accessToken",
")",
"{",
"for",
"(",
"Authentication",
"auth",
":",
"authentications",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"auth",
"instanceof",
"OAuth",
")",
"{",
"(",
"(",
"OAuth",
")",
"auth... | Helper method to set access token for the first OAuth2 authentication.
@param accessToken Access token | [
"Helper",
"method",
"to",
"set",
"access",
"token",
"for",
"the",
"first",
"OAuth2",
"authentication",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L337-L345 |
59,153 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.deserialize | @SuppressWarnings("unchecked")
public <T> T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
}
if ("byte[]".equals(returnType.toString())) {
// Handle binary response (byte array).
... | java | @SuppressWarnings("unchecked")
public <T> T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
}
if ("byte[]".equals(returnType.toString())) {
// Handle binary response (byte array).
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"deserialize",
"(",
"Response",
"response",
",",
"Type",
"returnType",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"response",
"==",
"null",
"||",
"returnType",
"==",
"null"... | Deserialize response body to Java object, according to the return type and
the Content-Type response header.
@param <T> Type
@param response HTTP response
@param returnType The type of the Java object
@return The deserialized Java object
@throws ApiException If fail to deserialize response body, i.e. cannot read respo... | [
"Deserialize",
"response",
"body",
"to",
"Java",
"object",
"according",
"to",
"the",
"return",
"type",
"and",
"the",
"Content",
"-",
"Type",
"response",
"header",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L634-L683 |
59,154 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.serialize | public RequestBody serialize(Object obj, String contentType) throws ApiException {
if (obj instanceof byte[]) {
// Binary (byte array) body parameter support.
return RequestBody.create(MediaType.parse(contentType), (byte[]) obj);
} else if (obj instanceof File) {
// F... | java | public RequestBody serialize(Object obj, String contentType) throws ApiException {
if (obj instanceof byte[]) {
// Binary (byte array) body parameter support.
return RequestBody.create(MediaType.parse(contentType), (byte[]) obj);
} else if (obj instanceof File) {
// F... | [
"public",
"RequestBody",
"serialize",
"(",
"Object",
"obj",
",",
"String",
"contentType",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"obj",
"instanceof",
"byte",
"[",
"]",
")",
"{",
"// Binary (byte array) body parameter support.",
"return",
"RequestBody",
".",
... | Serialize the given Java object into request body according to the object's
class and the request Content-Type.
@param obj The Java object
@param contentType The request Content-Type
@return The serialized request body
@throws ApiException If fail to serialize the given object | [
"Serialize",
"the",
"given",
"Java",
"object",
"into",
"request",
"body",
"according",
"to",
"the",
"object",
"s",
"class",
"and",
"the",
"request",
"Content",
"-",
"Type",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L694-L712 |
59,155 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.downloadFileFromResponse | public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
BufferedSink sink = Okio.buffer(Okio.sink(file));
sink.writeAll(response.body().source());
sink.close();
return file;
... | java | public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
BufferedSink sink = Okio.buffer(Okio.sink(file));
sink.writeAll(response.body().source());
sink.close();
return file;
... | [
"public",
"File",
"downloadFileFromResponse",
"(",
"Response",
"response",
")",
"throws",
"ApiException",
"{",
"try",
"{",
"File",
"file",
"=",
"prepareDownloadFile",
"(",
"response",
")",
";",
"BufferedSink",
"sink",
"=",
"Okio",
".",
"buffer",
"(",
"Okio",
"... | Download file from the given response.
@param response An instance of the Response object
@throws ApiException If fail to read file content from response and write to disk
@return Downloaded file | [
"Download",
"file",
"from",
"the",
"given",
"response",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L721-L731 |
59,156 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.execute | public <T> ApiResponse<T> execute(Call call, Type returnType) throws ApiException {
try {
Response response = call.execute();
T data = handleResponse(response, returnType);
return new ApiResponse<T>(response.code(), response.headers().toMultimap(), data);
} catch (IOE... | java | public <T> ApiResponse<T> execute(Call call, Type returnType) throws ApiException {
try {
Response response = call.execute();
T data = handleResponse(response, returnType);
return new ApiResponse<T>(response.code(), response.headers().toMultimap(), data);
} catch (IOE... | [
"public",
"<",
"T",
">",
"ApiResponse",
"<",
"T",
">",
"execute",
"(",
"Call",
"call",
",",
"Type",
"returnType",
")",
"throws",
"ApiException",
"{",
"try",
"{",
"Response",
"response",
"=",
"call",
".",
"execute",
"(",
")",
";",
"T",
"data",
"=",
"h... | Execute HTTP call and deserialize the HTTP response body into the given return type.
@param returnType The return type used to deserialize HTTP response body
@param <T> The return type corresponding to (same with) returnType
@param call Call
@return ApiResponse object containing response status, headers and
data, whic... | [
"Execute",
"HTTP",
"call",
"and",
"deserialize",
"the",
"HTTP",
"response",
"body",
"into",
"the",
"given",
"return",
"type",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L799-L807 |
59,157 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.executeAsync | @SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
call.enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
callback.onFailure(new ApiException(e), 0, nu... | java | @SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
call.enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
callback.onFailure(new ApiException(e), 0, nu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"void",
"executeAsync",
"(",
"Call",
"call",
",",
"final",
"Type",
"returnType",
",",
"final",
"ApiCallback",
"<",
"T",
">",
"callback",
")",
"{",
"call",
".",
"enqueue",
"(",
"... | Execute HTTP call asynchronously.
@see #execute(Call, Type)
@param <T> Type
@param call The callback to be executed when the API call finishes
@param returnType Return type
@param callback ApiCallback | [
"Execute",
"HTTP",
"call",
"asynchronously",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L829-L849 |
59,158 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.buildCall | public Call buildCall(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Request reques... | java | public Call buildCall(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Request reques... | [
"public",
"Call",
"buildCall",
"(",
"String",
"path",
",",
"String",
"method",
",",
"List",
"<",
"Pair",
">",
"queryParams",
",",
"List",
"<",
"Pair",
">",
"collectionQueryParams",
",",
"Object",
"body",
",",
"Map",
"<",
"String",
",",
"String",
">",
"he... | Build HTTP call with the given options.
@param path The sub-path of the HTTP URL
@param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
@param queryParams The query parameters
@param collectionQueryParams The collection query parameters
@param body The request body objec... | [
"Build",
"HTTP",
"call",
"with",
"the",
"given",
"options",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L905-L909 |
59,159 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.buildRequest | public Request buildRequest(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
updatePa... | java | public Request buildRequest(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
updatePa... | [
"public",
"Request",
"buildRequest",
"(",
"String",
"path",
",",
"String",
"method",
",",
"List",
"<",
"Pair",
">",
"queryParams",
",",
"List",
"<",
"Pair",
">",
"collectionQueryParams",
",",
"Object",
"body",
",",
"Map",
"<",
"String",
",",
"String",
">",... | Build an HTTP request with the given options.
@param path The sub-path of the HTTP URL
@param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
@param queryParams The query parameters
@param collectionQueryParams The collection query parameters
@param body The request body... | [
"Build",
"an",
"HTTP",
"request",
"with",
"the",
"given",
"options",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L926-L968 |
59,160 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.processHeaderParams | public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : headerParams.entrySet()) {
reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
}
for (Entry<String, String> header : defaultHeaderMap... | java | public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : headerParams.entrySet()) {
reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
}
for (Entry<String, String> header : defaultHeaderMap... | [
"public",
"void",
"processHeaderParams",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headerParams",
",",
"Request",
".",
"Builder",
"reqBuilder",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"param",
":",
"headerParams",
".",
"entr... | Set header parameters to the request builder, including default headers.
@param headerParams Header parameters in the ofrm of Map
@param reqBuilder Reqeust.Builder | [
"Set",
"header",
"parameters",
"to",
"the",
"request",
"builder",
"including",
"default",
"headers",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L1025-L1034 |
59,161 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.updateParamsForAuth | public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
... | java | public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
... | [
"public",
"void",
"updateParamsForAuth",
"(",
"String",
"[",
"]",
"authNames",
",",
"List",
"<",
"Pair",
">",
"queryParams",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headerParams",
")",
"{",
"for",
"(",
"String",
"authName",
":",
"authNames",
")",
... | Update query and header parameters based on authentication settings.
@param authNames The authentications to apply
@param queryParams List of query parameters
@param headerParams Map of header parameters | [
"Update",
"query",
"and",
"header",
"parameters",
"based",
"on",
"authentication",
"settings",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L1043-L1049 |
59,162 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.buildRequestBodyFormEncoding | public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams) {
FormEncodingBuilder formBuilder = new FormEncodingBuilder();
for (Entry<String, Object> param : formParams.entrySet()) {
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
}
... | java | public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams) {
FormEncodingBuilder formBuilder = new FormEncodingBuilder();
for (Entry<String, Object> param : formParams.entrySet()) {
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
}
... | [
"public",
"RequestBody",
"buildRequestBodyFormEncoding",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"formParams",
")",
"{",
"FormEncodingBuilder",
"formBuilder",
"=",
"new",
"FormEncodingBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"Obje... | Build a form-encoding request body with the given form parameters.
@param formParams Form parameters in the form of Map
@return RequestBody | [
"Build",
"a",
"form",
"-",
"encoding",
"request",
"body",
"with",
"the",
"given",
"form",
"parameters",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L1057-L1063 |
59,163 | kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.applySslSettings | private void applySslSettings() {
try {
TrustManager[] trustManagers = null;
HostnameVerifier hostnameVerifier = null;
if (!verifyingSsl) {
TrustManager trustAll = new X509TrustManager() {
@Override
public void checkClie... | java | private void applySslSettings() {
try {
TrustManager[] trustManagers = null;
HostnameVerifier hostnameVerifier = null;
if (!verifyingSsl) {
TrustManager trustAll = new X509TrustManager() {
@Override
public void checkClie... | [
"private",
"void",
"applySslSettings",
"(",
")",
"{",
"try",
"{",
"TrustManager",
"[",
"]",
"trustManagers",
"=",
"null",
";",
"HostnameVerifier",
"hostnameVerifier",
"=",
"null",
";",
"if",
"(",
"!",
"verifyingSsl",
")",
"{",
"TrustManager",
"trustAll",
"=",
... | Apply SSL related settings to httpClient according to the current values of
verifyingSsl and sslCaCert. | [
"Apply",
"SSL",
"related",
"settings",
"to",
"httpClient",
"according",
"to",
"the",
"current",
"values",
"of",
"verifyingSsl",
"and",
"sslCaCert",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L1107-L1155 |
59,164 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Controller.java | Controller.stop | public void stop() {
reflector.stop();
reflectorFuture.cancel(true);
reflectExecutor.shutdown();
if (resyncFuture != null) {
resyncFuture.cancel(true);
resyncExecutor.shutdown();
}
} | java | public void stop() {
reflector.stop();
reflectorFuture.cancel(true);
reflectExecutor.shutdown();
if (resyncFuture != null) {
resyncFuture.cancel(true);
resyncExecutor.shutdown();
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"reflector",
".",
"stop",
"(",
")",
";",
"reflectorFuture",
".",
"cancel",
"(",
"true",
")",
";",
"reflectExecutor",
".",
"shutdown",
"(",
")",
";",
"if",
"(",
"resyncFuture",
"!=",
"null",
")",
"{",
"resyncFutu... | stops the resync thread pool firstly, then stop the reflector | [
"stops",
"the",
"resync",
"thread",
"pool",
"firstly",
"then",
"stop",
"the",
"reflector"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Controller.java#L111-L121 |
59,165 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Controller.java | Controller.processLoop | private void processLoop() {
while (true) {
try {
this.queue.pop(this.processFunc);
} catch (InterruptedException t) {
log.error("DefaultController#processLoop get interrupted {}", t.getMessage(), t);
}
}
} | java | private void processLoop() {
while (true) {
try {
this.queue.pop(this.processFunc);
} catch (InterruptedException t) {
log.error("DefaultController#processLoop get interrupted {}", t.getMessage(), t);
}
}
} | [
"private",
"void",
"processLoop",
"(",
")",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"this",
".",
"queue",
".",
"pop",
"(",
"this",
".",
"processFunc",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"t",
")",
"{",
"log",
".",
"error",
... | processLoop drains the work queue. | [
"processLoop",
"drains",
"the",
"work",
"queue",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Controller.java#L137-L145 |
59,166 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.add | @Override
public void add(Object obj) {
lock.writeLock().lock();
try {
populated = true;
this.queueActionLocked(DeltaType.Added, obj);
} finally {
lock.writeLock().unlock();
}
} | java | @Override
public void add(Object obj) {
lock.writeLock().lock();
try {
populated = true;
this.queueActionLocked(DeltaType.Added, obj);
} finally {
lock.writeLock().unlock();
}
} | [
"@",
"Override",
"public",
"void",
"add",
"(",
"Object",
"obj",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"populated",
"=",
"true",
";",
"this",
".",
"queueActionLocked",
"(",
"DeltaType",
".",
"Added",
","... | Add items to the delta FIFO.
@param obj the obj | [
"Add",
"items",
"to",
"the",
"delta",
"FIFO",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L67-L76 |
59,167 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.update | @Override
public void update(Object obj) {
lock.writeLock().lock();
try {
populated = true;
this.queueActionLocked(DeltaType.Updated, obj);
} finally {
lock.writeLock().unlock();
}
} | java | @Override
public void update(Object obj) {
lock.writeLock().lock();
try {
populated = true;
this.queueActionLocked(DeltaType.Updated, obj);
} finally {
lock.writeLock().unlock();
}
} | [
"@",
"Override",
"public",
"void",
"update",
"(",
"Object",
"obj",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"populated",
"=",
"true",
";",
"this",
".",
"queueActionLocked",
"(",
"DeltaType",
".",
"Updated",
... | Update items in the delta FIFO.
@param obj the obj | [
"Update",
"items",
"in",
"the",
"delta",
"FIFO",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L83-L92 |
59,168 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.delete | @Override
public void delete(Object obj) {
String id = this.keyOf(obj);
lock.writeLock().lock();
try {
this.populated = true;
if (this.knownObjects == null) {
if (!this.items.containsKey(id)) {
// Presumably, this was deleted when a relist happened.
// Don't provide... | java | @Override
public void delete(Object obj) {
String id = this.keyOf(obj);
lock.writeLock().lock();
try {
this.populated = true;
if (this.knownObjects == null) {
if (!this.items.containsKey(id)) {
// Presumably, this was deleted when a relist happened.
// Don't provide... | [
"@",
"Override",
"public",
"void",
"delete",
"(",
"Object",
"obj",
")",
"{",
"String",
"id",
"=",
"this",
".",
"keyOf",
"(",
"obj",
")",
";",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"this",
".",
"populated",
"=... | Delete items from the delta FIFO.
@param obj the obj | [
"Delete",
"items",
"from",
"the",
"delta",
"FIFO",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L99-L122 |
59,169 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.replace | @Override
public void replace(List list, String resourceVersion) {
lock.writeLock().lock();
try {
Set<String> keys = new HashSet<>();
for (Object obj : list) {
String key = this.keyOf(obj);
keys.add(key);
this.queueActionLocked(DeltaType.Sync, obj);
}
if (this.... | java | @Override
public void replace(List list, String resourceVersion) {
lock.writeLock().lock();
try {
Set<String> keys = new HashSet<>();
for (Object obj : list) {
String key = this.keyOf(obj);
keys.add(key);
this.queueActionLocked(DeltaType.Sync, obj);
}
if (this.... | [
"@",
"Override",
"public",
"void",
"replace",
"(",
"List",
"list",
",",
"String",
"resourceVersion",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"Set",
"<",
"String",
">",
"keys",
"=",
"new",
"HashSet",
"<>",... | Replace the item forcibly.
@param list the list
@param resourceVersion the resource version | [
"Replace",
"the",
"item",
"forcibly",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L130-L190 |
59,170 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.resync | @Override
public void resync() {
lock.writeLock().lock();
try {
if (this.knownObjects == null) {
return;
}
List<String> keys = this.knownObjects.listKeys();
for (String key : keys) {
syncKeyLocked(key);
}
} finally {
lock.writeLock().unlock();
}
} | java | @Override
public void resync() {
lock.writeLock().lock();
try {
if (this.knownObjects == null) {
return;
}
List<String> keys = this.knownObjects.listKeys();
for (String key : keys) {
syncKeyLocked(key);
}
} finally {
lock.writeLock().unlock();
}
} | [
"@",
"Override",
"public",
"void",
"resync",
"(",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"this",
".",
"knownObjects",
"==",
"null",
")",
"{",
"return",
";",
"}",
"List",
"<",
"String",
">"... | Re-sync the delta FIFO. First, It locks the queue to block any more write operation until it
finishes processing all the pending items in the queue. | [
"Re",
"-",
"sync",
"the",
"delta",
"FIFO",
".",
"First",
"It",
"locks",
"the",
"queue",
"to",
"block",
"any",
"more",
"write",
"operation",
"until",
"it",
"finishes",
"processing",
"all",
"the",
"pending",
"items",
"in",
"the",
"queue",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L196-L211 |
59,171 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.listKeys | @Override
public List<String> listKeys() {
lock.readLock().lock();
try {
List<String> keyList = new ArrayList<>(items.size());
for (Map.Entry<String, Deque<MutablePair<DeltaType, Object>>> entry : items.entrySet()) {
keyList.add(entry.getKey());
}
return keyList;
} finally ... | java | @Override
public List<String> listKeys() {
lock.readLock().lock();
try {
List<String> keyList = new ArrayList<>(items.size());
for (Map.Entry<String, Deque<MutablePair<DeltaType, Object>>> entry : items.entrySet()) {
keyList.add(entry.getKey());
}
return keyList;
} finally ... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"listKeys",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"List",
"<",
"String",
">",
"keyList",
"=",
"new",
"ArrayList",
"<>",
"(",
"items",
".",
... | List keys list.
@return the list | [
"List",
"keys",
"list",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L218-L230 |
59,172 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.get | @Override
public Object get(Object obj) {
String key = this.keyOf(obj);
return this.getByKey(key);
} | java | @Override
public Object get(Object obj) {
String key = this.keyOf(obj);
return this.getByKey(key);
} | [
"@",
"Override",
"public",
"Object",
"get",
"(",
"Object",
"obj",
")",
"{",
"String",
"key",
"=",
"this",
".",
"keyOf",
"(",
"obj",
")",
";",
"return",
"this",
".",
"getByKey",
"(",
"key",
")",
";",
"}"
] | Get object.
@param obj the obj
@return the object | [
"Get",
"object",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L238-L242 |
59,173 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.list | @Override
public List<Object> list() {
lock.readLock().lock();
List<Object> objects = new ArrayList<>();
try {
// TODO: make a generic deep copy utility
for (Map.Entry<String, Deque<MutablePair<DeltaType, Object>>> entry : items.entrySet()) {
Deque<MutablePair<DeltaType, Object>> copie... | java | @Override
public List<Object> list() {
lock.readLock().lock();
List<Object> objects = new ArrayList<>();
try {
// TODO: make a generic deep copy utility
for (Map.Entry<String, Deque<MutablePair<DeltaType, Object>>> entry : items.entrySet()) {
Deque<MutablePair<DeltaType, Object>> copie... | [
"@",
"Override",
"public",
"List",
"<",
"Object",
">",
"list",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"List",
"<",
"Object",
">",
"objects",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"// TODO... | List list.
@return the list | [
"List",
"list",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L270-L284 |
59,174 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.pop | public Deque<MutablePair<DeltaType, Object>> pop(
Consumer<Deque<MutablePair<DeltaType, Object>>> func) throws InterruptedException {
lock.writeLock().lock();
try {
while (true) {
while (queue.isEmpty()) {
notEmpty.await();
}
// there should have data now
St... | java | public Deque<MutablePair<DeltaType, Object>> pop(
Consumer<Deque<MutablePair<DeltaType, Object>>> func) throws InterruptedException {
lock.writeLock().lock();
try {
while (true) {
while (queue.isEmpty()) {
notEmpty.await();
}
// there should have data now
St... | [
"public",
"Deque",
"<",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
">",
"pop",
"(",
"Consumer",
"<",
"Deque",
"<",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
">",
">",
"func",
")",
"throws",
"InterruptedException",
"{",
"lock",
".",
"... | Pop deltas.
@param func the func
@return the deltas
@throws Exception the exception | [
"Pop",
"deltas",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L293-L320 |
59,175 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.queueActionLocked | private void queueActionLocked(DeltaType actionType, Object obj) {
String id = this.keyOf(obj);
// If object is supposed to be deleted (last event is Deleted),
// then we should ignore Sync events, because it would result in
// recreation of this object.
if (actionType == DeltaType.Sync && this.wil... | java | private void queueActionLocked(DeltaType actionType, Object obj) {
String id = this.keyOf(obj);
// If object is supposed to be deleted (last event is Deleted),
// then we should ignore Sync events, because it would result in
// recreation of this object.
if (actionType == DeltaType.Sync && this.wil... | [
"private",
"void",
"queueActionLocked",
"(",
"DeltaType",
"actionType",
",",
"Object",
"obj",
")",
"{",
"String",
"id",
"=",
"this",
".",
"keyOf",
"(",
"obj",
")",
";",
"// If object is supposed to be deleted (last event is Deleted),",
"// then we should ignore Sync event... | queueActionLocked appends to the delta list for the object. Caller must hold the lock. | [
"queueActionLocked",
"appends",
"to",
"the",
"delta",
"list",
"for",
"the",
"object",
".",
"Caller",
"must",
"hold",
"the",
"lock",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L337-L370 |
59,176 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.willObjectBeDeletedLocked | private boolean willObjectBeDeletedLocked(String id) {
if (!this.items.containsKey(id)) {
return false;
}
Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(id);
return !(Collections.isEmptyCollection(deltas))
&& deltas.peekLast().getLeft().equals(DeltaType.Deleted);
} | java | private boolean willObjectBeDeletedLocked(String id) {
if (!this.items.containsKey(id)) {
return false;
}
Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(id);
return !(Collections.isEmptyCollection(deltas))
&& deltas.peekLast().getLeft().equals(DeltaType.Deleted);
} | [
"private",
"boolean",
"willObjectBeDeletedLocked",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"!",
"this",
".",
"items",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"return",
"false",
";",
"}",
"Deque",
"<",
"MutablePair",
"<",
"DeltaType",
",",
"Object... | willObjectBeDeletedLocked returns true only if the last delta for the give object is Deleted.
Caller must hold the lock. | [
"willObjectBeDeletedLocked",
"returns",
"true",
"only",
"if",
"the",
"last",
"delta",
"for",
"the",
"give",
"object",
"is",
"Deleted",
".",
"Caller",
"must",
"hold",
"the",
"lock",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L376-L383 |
59,177 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.keyOf | private String keyOf(Object obj) {
Object innerObj = obj;
if (obj instanceof Deque) {
Deque<MutablePair<DeltaType, Object>> deltas = (Deque<MutablePair<DeltaType, Object>>) obj;
if (deltas.size() == 0) {
throw new NoSuchElementException("0 length Deltas object; can't get key");
}
... | java | private String keyOf(Object obj) {
Object innerObj = obj;
if (obj instanceof Deque) {
Deque<MutablePair<DeltaType, Object>> deltas = (Deque<MutablePair<DeltaType, Object>>) obj;
if (deltas.size() == 0) {
throw new NoSuchElementException("0 length Deltas object; can't get key");
}
... | [
"private",
"String",
"keyOf",
"(",
"Object",
"obj",
")",
"{",
"Object",
"innerObj",
"=",
"obj",
";",
"if",
"(",
"obj",
"instanceof",
"Deque",
")",
"{",
"Deque",
"<",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
">",
"deltas",
"=",
"(",
"Deque",... | DeletedFinalStateUnknown objects. | [
"DeletedFinalStateUnknown",
"objects",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L387-L400 |
59,178 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.syncKeyLocked | private void syncKeyLocked(String key) {
ApiType obj = this.knownObjects.getByKey(key);
if (obj == null) {
return;
}
String id = this.keyOf(obj);
Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(id);
if (deltas != null && !(Collections.isEmptyCollection(deltas))) {
retu... | java | private void syncKeyLocked(String key) {
ApiType obj = this.knownObjects.getByKey(key);
if (obj == null) {
return;
}
String id = this.keyOf(obj);
Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(id);
if (deltas != null && !(Collections.isEmptyCollection(deltas))) {
retu... | [
"private",
"void",
"syncKeyLocked",
"(",
"String",
"key",
")",
"{",
"ApiType",
"obj",
"=",
"this",
".",
"knownObjects",
".",
"getByKey",
"(",
"key",
")",
";",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
"id",
"=",
"this",
... | Add Sync delta. Caller must hold the lock. | [
"Add",
"Sync",
"delta",
".",
"Caller",
"must",
"hold",
"the",
"lock",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L403-L416 |
59,179 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.combineDeltas | private Deque<MutablePair<DeltaType, Object>> combineDeltas(
LinkedList<MutablePair<DeltaType, Object>> deltas) {
if (deltas.size() < 2) {
return deltas;
}
int size = deltas.size();
MutablePair<DeltaType, Object> d1 = deltas.peekLast();
MutablePair<DeltaType, Object> d2 = deltas.get(size... | java | private Deque<MutablePair<DeltaType, Object>> combineDeltas(
LinkedList<MutablePair<DeltaType, Object>> deltas) {
if (deltas.size() < 2) {
return deltas;
}
int size = deltas.size();
MutablePair<DeltaType, Object> d1 = deltas.peekLast();
MutablePair<DeltaType, Object> d2 = deltas.get(size... | [
"private",
"Deque",
"<",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
">",
"combineDeltas",
"(",
"LinkedList",
"<",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
">",
"deltas",
")",
"{",
"if",
"(",
"deltas",
".",
"size",
"(",
")",
"<",
"... | order. This will combine the most recent two deltas if they are the same. | [
"order",
".",
"This",
"will",
"combine",
"the",
"most",
"recent",
"two",
"deltas",
"if",
"they",
"are",
"the",
"same",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L420-L436 |
59,180 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.isDuplicate | private MutablePair<DeltaType, Object> isDuplicate(
MutablePair<DeltaType, Object> d1, MutablePair<DeltaType, Object> d2) {
MutablePair<DeltaType, Object> deletionDelta = isDeletionDup(d1, d2);
if (deletionDelta != null) {
return deletionDelta;
}
return null;
} | java | private MutablePair<DeltaType, Object> isDuplicate(
MutablePair<DeltaType, Object> d1, MutablePair<DeltaType, Object> d2) {
MutablePair<DeltaType, Object> deletionDelta = isDeletionDup(d1, d2);
if (deletionDelta != null) {
return deletionDelta;
}
return null;
} | [
"private",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
"isDuplicate",
"(",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
"d1",
",",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
"d2",
")",
"{",
"MutablePair",
"<",
"DeltaType",
",",
"... | If d1 & d2 represent the same event, returns the delta that ought to be kept.
@param d1 the elder one
@param d2 the most one
@return the one ought to be kept | [
"If",
"d1",
"&",
"d2",
"represent",
"the",
"same",
"event",
"returns",
"the",
"delta",
"that",
"ought",
"to",
"be",
"kept",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L445-L452 |
59,181 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java | DeltaFIFO.isDeletionDup | private MutablePair<DeltaType, Object> isDeletionDup(
MutablePair<DeltaType, Object> d1, MutablePair<DeltaType, Object> d2) {
if (!d1.getLeft().equals(DeltaType.Deleted) || !d2.getLeft().equals(DeltaType.Deleted)) {
return null;
}
Object obj = d2.getRight();
if (obj instanceof DeletedFinalSt... | java | private MutablePair<DeltaType, Object> isDeletionDup(
MutablePair<DeltaType, Object> d1, MutablePair<DeltaType, Object> d2) {
if (!d1.getLeft().equals(DeltaType.Deleted) || !d2.getLeft().equals(DeltaType.Deleted)) {
return null;
}
Object obj = d2.getRight();
if (obj instanceof DeletedFinalSt... | [
"private",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
"isDeletionDup",
"(",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
"d1",
",",
"MutablePair",
"<",
"DeltaType",
",",
"Object",
">",
"d2",
")",
"{",
"if",
"(",
"!",
"d1",
".",
"getLeft... | keep the one with the most information if both are deletions.
@param d1 the most one
@param d2 the elder one
@return the most one | [
"keep",
"the",
"one",
"with",
"the",
"most",
"information",
"if",
"both",
"are",
"deletions",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java#L461-L471 |
59,182 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/ReflectorRunnable.java | ReflectorRunnable.run | public void run() {
try {
log.info("{}#Start listing and watching...", apiTypeClass);
ApiListType list = listerWatcher.list(new CallGeneratorParams(Boolean.FALSE, null, null));
V1ListMeta listMeta = Reflect.listMetadata(list);
String resourceVersion = listMeta.getResourceVersion();
L... | java | public void run() {
try {
log.info("{}#Start listing and watching...", apiTypeClass);
ApiListType list = listerWatcher.list(new CallGeneratorParams(Boolean.FALSE, null, null));
V1ListMeta listMeta = Reflect.listMetadata(list);
String resourceVersion = listMeta.getResourceVersion();
L... | [
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"log",
".",
"info",
"(",
"\"{}#Start listing and watching...\"",
",",
"apiTypeClass",
")",
";",
"ApiListType",
"list",
"=",
"listerWatcher",
".",
"list",
"(",
"new",
"CallGeneratorParams",
"(",
"Boolean",
"."... | run first lists all items and get the resource version at the moment of call, and then use the
resource version to watch. | [
"run",
"first",
"lists",
"all",
"items",
"and",
"get",
"the",
"resource",
"version",
"at",
"the",
"moment",
"of",
"call",
"and",
"then",
"use",
"the",
"resource",
"version",
"to",
"watch",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/ReflectorRunnable.java#L43-L113 |
59,183 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/util/ClientBuilder.java | ClientBuilder.cluster | public static ClientBuilder cluster() throws IOException {
final ClientBuilder builder = new ClientBuilder();
final String host = System.getenv(ENV_SERVICE_HOST);
final String port = System.getenv(ENV_SERVICE_PORT);
builder.setBasePath("https://" + host + ":" + port);
final String token =
... | java | public static ClientBuilder cluster() throws IOException {
final ClientBuilder builder = new ClientBuilder();
final String host = System.getenv(ENV_SERVICE_HOST);
final String port = System.getenv(ENV_SERVICE_PORT);
builder.setBasePath("https://" + host + ":" + port);
final String token =
... | [
"public",
"static",
"ClientBuilder",
"cluster",
"(",
")",
"throws",
"IOException",
"{",
"final",
"ClientBuilder",
"builder",
"=",
"new",
"ClientBuilder",
"(",
")",
";",
"final",
"String",
"host",
"=",
"System",
".",
"getenv",
"(",
"ENV_SERVICE_HOST",
")",
";",... | Creates a builder which is pre-configured from the cluster configuration.
@return <tt>ClientBuilder</tt> configured from the cluster configuration.
@throws IOException if the Service Account Token Path or CA Path is not readable. | [
"Creates",
"a",
"builder",
"which",
"is",
"pre",
"-",
"configured",
"from",
"the",
"cluster",
"configuration",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/ClientBuilder.java#L196-L210 |
59,184 | kubernetes-client/java | examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java | ExpandedExample.getAllNameSpaces | public static List<String> getAllNameSpaces() throws ApiException {
V1NamespaceList listNamespace =
COREV1_API.listNamespace(
null, "true", null, null, null, 0, null, Integer.MAX_VALUE, Boolean.FALSE);
List<String> list =
listNamespace
.getItems()
.stream()
... | java | public static List<String> getAllNameSpaces() throws ApiException {
V1NamespaceList listNamespace =
COREV1_API.listNamespace(
null, "true", null, null, null, 0, null, Integer.MAX_VALUE, Boolean.FALSE);
List<String> list =
listNamespace
.getItems()
.stream()
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getAllNameSpaces",
"(",
")",
"throws",
"ApiException",
"{",
"V1NamespaceList",
"listNamespace",
"=",
"COREV1_API",
".",
"listNamespace",
"(",
"null",
",",
"\"true\"",
",",
"null",
",",
"null",
",",
"null",
",",
... | Get all namespaces in k8s cluster
@return
@throws ApiException | [
"Get",
"all",
"namespaces",
"in",
"k8s",
"cluster"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java#L103-L114 |
59,185 | kubernetes-client/java | examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java | ExpandedExample.getPods | public static List<String> getPods() throws ApiException {
V1PodList v1podList =
COREV1_API.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null);
List<String> podList =
v1podList
.getItems()
.stream()
.map(v1Pod -> v1Pod.getMetadata().... | java | public static List<String> getPods() throws ApiException {
V1PodList v1podList =
COREV1_API.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null);
List<String> podList =
v1podList
.getItems()
.stream()
.map(v1Pod -> v1Pod.getMetadata().... | [
"public",
"static",
"List",
"<",
"String",
">",
"getPods",
"(",
")",
"throws",
"ApiException",
"{",
"V1PodList",
"v1podList",
"=",
"COREV1_API",
".",
"listPodForAllNamespaces",
"(",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
"... | List all pod names in all namespaces in k8s cluster
@return
@throws ApiException | [
"List",
"all",
"pod",
"names",
"in",
"all",
"namespaces",
"in",
"k8s",
"cluster"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java#L122-L132 |
59,186 | kubernetes-client/java | examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java | ExpandedExample.getNamespacedPod | public static List<String> getNamespacedPod(String namespace, String label) throws ApiException {
V1PodList listNamespacedPod =
COREV1_API.listNamespacedPod(
namespace,
null,
null,
null,
null,
label,
Integer.MAX_VALUE,
... | java | public static List<String> getNamespacedPod(String namespace, String label) throws ApiException {
V1PodList listNamespacedPod =
COREV1_API.listNamespacedPod(
namespace,
null,
null,
null,
null,
label,
Integer.MAX_VALUE,
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getNamespacedPod",
"(",
"String",
"namespace",
",",
"String",
"label",
")",
"throws",
"ApiException",
"{",
"V1PodList",
"listNamespacedPod",
"=",
"COREV1_API",
".",
"listNamespacedPod",
"(",
"namespace",
",",
"null"... | List pod in specific namespace with label
@param namespace
@param label
@return
@throws ApiException | [
"List",
"pod",
"in",
"specific",
"namespace",
"with",
"label"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java#L163-L183 |
59,187 | kubernetes-client/java | examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java | ExpandedExample.getServices | public static List<String> getServices() throws ApiException {
V1ServiceList listNamespacedService =
COREV1_API.listNamespacedService(
DEFAULT_NAME_SPACE,
null,
null,
null,
null,
null,
Integer.MAX_VALUE,
null,
... | java | public static List<String> getServices() throws ApiException {
V1ServiceList listNamespacedService =
COREV1_API.listNamespacedService(
DEFAULT_NAME_SPACE,
null,
null,
null,
null,
null,
Integer.MAX_VALUE,
null,
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getServices",
"(",
")",
"throws",
"ApiException",
"{",
"V1ServiceList",
"listNamespacedService",
"=",
"COREV1_API",
".",
"listNamespacedService",
"(",
"DEFAULT_NAME_SPACE",
",",
"null",
",",
"null",
",",
"null",
","... | List all Services in default namespace
@return
@throws ApiException | [
"List",
"all",
"Services",
"in",
"default",
"namespace"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java#L191-L209 |
59,188 | kubernetes-client/java | examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java | ExpandedExample.printLog | public static void printLog(String namespace, String podName) throws ApiException {
// https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog
String readNamespacedPodLog =
COREV1_API.readNamespacedPodLog(
podName,
namespace,
... | java | public static void printLog(String namespace, String podName) throws ApiException {
// https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog
String readNamespacedPodLog =
COREV1_API.readNamespacedPodLog(
podName,
namespace,
... | [
"public",
"static",
"void",
"printLog",
"(",
"String",
"namespace",
",",
"String",
"podName",
")",
"throws",
"ApiException",
"{",
"// https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog",
"String",
"readNamespacedPodLog",
"=",
"... | Print out the Log for specific Pods
@param namespace
@param podName
@throws ApiException | [
"Print",
"out",
"the",
"Log",
"for",
"specific",
"Pods"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java#L255-L270 |
59,189 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/util/KubeConfig.java | KubeConfig.loadKubeConfig | public static KubeConfig loadKubeConfig(Reader input) {
Yaml yaml = new Yaml(new SafeConstructor());
Object config = yaml.load(input);
Map<String, Object> configMap = (Map<String, Object>) config;
String currentContext = (String) configMap.get("current-context");
ArrayList<Object> contexts = (Array... | java | public static KubeConfig loadKubeConfig(Reader input) {
Yaml yaml = new Yaml(new SafeConstructor());
Object config = yaml.load(input);
Map<String, Object> configMap = (Map<String, Object>) config;
String currentContext = (String) configMap.get("current-context");
ArrayList<Object> contexts = (Array... | [
"public",
"static",
"KubeConfig",
"loadKubeConfig",
"(",
"Reader",
"input",
")",
"{",
"Yaml",
"yaml",
"=",
"new",
"Yaml",
"(",
"new",
"SafeConstructor",
"(",
")",
")",
";",
"Object",
"config",
"=",
"yaml",
".",
"load",
"(",
"input",
")",
";",
"Map",
"<... | Load a Kubernetes config from a Reader | [
"Load",
"a",
"Kubernetes",
"config",
"from",
"a",
"Reader"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/KubeConfig.java#L80-L96 |
59,190 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/util/KubeConfig.java | KubeConfig.tokenViaExecCredential | @SuppressWarnings("unchecked")
private String tokenViaExecCredential(Map<String, Object> execMap) {
if (execMap == null) {
return null;
}
String apiVersion = (String) execMap.get("apiVersion");
if (!"client.authentication.k8s.io/v1beta1".equals(apiVersion)
&& !"client.authentication.k8s.... | java | @SuppressWarnings("unchecked")
private String tokenViaExecCredential(Map<String, Object> execMap) {
if (execMap == null) {
return null;
}
String apiVersion = (String) execMap.get("apiVersion");
if (!"client.authentication.k8s.io/v1beta1".equals(apiVersion)
&& !"client.authentication.k8s.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"String",
"tokenViaExecCredential",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"execMap",
")",
"{",
"if",
"(",
"execMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"apiV... | Attempt to create an access token by running a configured external program.
@see <a
href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins">
Authenticating » client-go credential plugins</a> | [
"Attempt",
"to",
"create",
"an",
"access",
"token",
"by",
"running",
"a",
"configured",
"external",
"program",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/KubeConfig.java#L255-L294 |
59,191 | kubernetes-client/java | extended/src/main/java/io/kubernetes/client/extended/pager/Pager.java | Pager.getNextCall | private Call getNextCall(Integer nextLimit, String continueToken) {
PagerParams params = new PagerParams((nextLimit != null) ? nextLimit : limit, continueToken);
return listFunc.apply(params);
} | java | private Call getNextCall(Integer nextLimit, String continueToken) {
PagerParams params = new PagerParams((nextLimit != null) ? nextLimit : limit, continueToken);
return listFunc.apply(params);
} | [
"private",
"Call",
"getNextCall",
"(",
"Integer",
"nextLimit",
",",
"String",
"continueToken",
")",
"{",
"PagerParams",
"params",
"=",
"new",
"PagerParams",
"(",
"(",
"nextLimit",
"!=",
"null",
")",
"?",
"nextLimit",
":",
"limit",
",",
"continueToken",
")",
... | returns next list call by setting continue variable and limit | [
"returns",
"next",
"list",
"call",
"by",
"setting",
"continue",
"variable",
"and",
"limit"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/extended/src/main/java/io/kubernetes/client/extended/pager/Pager.java#L65-L68 |
59,192 | kubernetes-client/java | extended/src/main/java/io/kubernetes/client/extended/pager/Pager.java | Pager.executeRequest | private ApiListType executeRequest(Call call) throws IOException, ApiException {
return client.handleResponse(call.execute(), listType);
} | java | private ApiListType executeRequest(Call call) throws IOException, ApiException {
return client.handleResponse(call.execute(), listType);
} | [
"private",
"ApiListType",
"executeRequest",
"(",
"Call",
"call",
")",
"throws",
"IOException",
",",
"ApiException",
"{",
"return",
"client",
".",
"handleResponse",
"(",
"call",
".",
"execute",
"(",
")",
",",
"listType",
")",
";",
"}"
] | executes the list call and sets the continue variable for next list call | [
"executes",
"the",
"list",
"call",
"and",
"sets",
"the",
"continue",
"variable",
"for",
"next",
"list",
"call"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/extended/src/main/java/io/kubernetes/client/extended/pager/Pager.java#L71-L73 |
59,193 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/PortForward.java | PortForward.forward | public PortForwardResult forward(V1Pod pod, List<Integer> ports)
throws ApiException, IOException {
return forward(pod.getMetadata().getNamespace(), pod.getMetadata().getName(), ports);
} | java | public PortForwardResult forward(V1Pod pod, List<Integer> ports)
throws ApiException, IOException {
return forward(pod.getMetadata().getNamespace(), pod.getMetadata().getName(), ports);
} | [
"public",
"PortForwardResult",
"forward",
"(",
"V1Pod",
"pod",
",",
"List",
"<",
"Integer",
">",
"ports",
")",
"throws",
"ApiException",
",",
"IOException",
"{",
"return",
"forward",
"(",
"pod",
".",
"getMetadata",
"(",
")",
".",
"getNamespace",
"(",
")",
... | PortForward to a container
@param pod The pod where the port forward is run.
@param ports The ports to forward
@return The result of the Port Forward request. | [
"PortForward",
"to",
"a",
"container"
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/PortForward.java#L90-L93 |
59,194 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/PortForward.java | PortForward.forward | public PortForwardResult forward(String namespace, String name, List<Integer> ports)
throws ApiException, IOException {
String path = makePath(namespace, name);
WebSocketStreamHandler handler = new WebSocketStreamHandler();
PortForwardResult result = new PortForwardResult(handler, ports);
List<Pai... | java | public PortForwardResult forward(String namespace, String name, List<Integer> ports)
throws ApiException, IOException {
String path = makePath(namespace, name);
WebSocketStreamHandler handler = new WebSocketStreamHandler();
PortForwardResult result = new PortForwardResult(handler, ports);
List<Pai... | [
"public",
"PortForwardResult",
"forward",
"(",
"String",
"namespace",
",",
"String",
"name",
",",
"List",
"<",
"Integer",
">",
"ports",
")",
"throws",
"ApiException",
",",
"IOException",
"{",
"String",
"path",
"=",
"makePath",
"(",
"namespace",
",",
"name",
... | PortForward to a container.
@param namespace The namespace of the Pod
@param name The name of the Pod
@param ports The ports to forward
@return The result of the Port Forward request. | [
"PortForward",
"to",
"a",
"container",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/PortForward.java#L103-L118 |
59,195 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.add | @Override
public void add(ApiType obj) {
String key = keyFunc.apply(obj);
lock.lock();
try {
ApiType oldObj = this.items.get(key);
this.items.put(key, obj);
this.updateIndices(oldObj, obj, key);
} finally {
lock.unlock();
}
} | java | @Override
public void add(ApiType obj) {
String key = keyFunc.apply(obj);
lock.lock();
try {
ApiType oldObj = this.items.get(key);
this.items.put(key, obj);
this.updateIndices(oldObj, obj, key);
} finally {
lock.unlock();
}
} | [
"@",
"Override",
"public",
"void",
"add",
"(",
"ApiType",
"obj",
")",
"{",
"String",
"key",
"=",
"keyFunc",
".",
"apply",
"(",
"obj",
")",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"ApiType",
"oldObj",
"=",
"this",
".",
"items",
".",
"... | Add objects.
@param obj the obj | [
"Add",
"objects",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L67-L78 |
59,196 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.delete | @Override
public void delete(ApiType obj) {
String key = keyFunc.apply(obj);
lock.lock();
try {
boolean exists = this.items.containsKey(key);
if (exists) {
this.deleteFromIndices(this.items.get(key), key);
this.items.remove(key);
}
} finally {
lock.unlock();
... | java | @Override
public void delete(ApiType obj) {
String key = keyFunc.apply(obj);
lock.lock();
try {
boolean exists = this.items.containsKey(key);
if (exists) {
this.deleteFromIndices(this.items.get(key), key);
this.items.remove(key);
}
} finally {
lock.unlock();
... | [
"@",
"Override",
"public",
"void",
"delete",
"(",
"ApiType",
"obj",
")",
"{",
"String",
"key",
"=",
"keyFunc",
".",
"apply",
"(",
"obj",
")",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"boolean",
"exists",
"=",
"this",
".",
"items",
".",
... | Delete the object.
@param obj the obj | [
"Delete",
"the",
"object",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L103-L116 |
59,197 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.replace | @Override
public void replace(List<ApiType> list, String resourceVersion) {
lock.lock();
try {
Map<String, ApiType> newItems = new HashMap<>();
for (ApiType item : list) {
String key = keyFunc.apply(item);
newItems.put(key, item);
}
this.items = newItems;
// rebu... | java | @Override
public void replace(List<ApiType> list, String resourceVersion) {
lock.lock();
try {
Map<String, ApiType> newItems = new HashMap<>();
for (ApiType item : list) {
String key = keyFunc.apply(item);
newItems.put(key, item);
}
this.items = newItems;
// rebu... | [
"@",
"Override",
"public",
"void",
"replace",
"(",
"List",
"<",
"ApiType",
">",
"list",
",",
"String",
"resourceVersion",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"Map",
"<",
"String",
",",
"ApiType",
">",
"newItems",
"=",
"new",
"Ha... | Replace the content in the cache completely.
@param list the list
@param resourceVersion the resource version | [
"Replace",
"the",
"content",
"in",
"the",
"cache",
"completely",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L124-L143 |
59,198 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.listKeys | @Override
public List<String> listKeys() {
lock.lock();
try {
List<String> keys = new ArrayList<>(this.items.size());
for (Map.Entry<String, ApiType> entry : this.items.entrySet()) {
keys.add(entry.getKey());
}
return keys;
} finally {
lock.unlock();
}
} | java | @Override
public List<String> listKeys() {
lock.lock();
try {
List<String> keys = new ArrayList<>(this.items.size());
for (Map.Entry<String, ApiType> entry : this.items.entrySet()) {
keys.add(entry.getKey());
}
return keys;
} finally {
lock.unlock();
}
} | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"listKeys",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"List",
"<",
"String",
">",
"keys",
"=",
"new",
"ArrayList",
"<>",
"(",
"this",
".",
"items",
".",
"size",
"(",
")",... | List keys.
@return the list | [
"List",
"keys",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L156-L168 |
59,199 | kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.get | @Override
public ApiType get(ApiType obj) {
String key = this.keyFunc.apply(obj);
lock.lock();
try {
return this.getByKey(key);
} finally {
lock.unlock();
}
} | java | @Override
public ApiType get(ApiType obj) {
String key = this.keyFunc.apply(obj);
lock.lock();
try {
return this.getByKey(key);
} finally {
lock.unlock();
}
} | [
"@",
"Override",
"public",
"ApiType",
"get",
"(",
"ApiType",
"obj",
")",
"{",
"String",
"key",
"=",
"this",
".",
"keyFunc",
".",
"apply",
"(",
"obj",
")",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"this",
".",
"getByKey",
"(",
... | Get object t.
@param obj the obj
@return the t | [
"Get",
"object",
"t",
"."
] | 7413e98bd904f09d1ad00fb60e8c6ff787f3f560 | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L176-L185 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.