repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangeDialog.java
DateRangeDialog.show
public static void show(DateRange dateRange, IResponseCallback<DateRange> callback) { """ Displays the date range dialog. @param dateRange The initial date range. @param callback Callback for returning a date range reflecting the inputs from the dialog. This will be null if the input is cancelled or if an une...
java
public static void show(DateRange dateRange, IResponseCallback<DateRange> callback) { Map<String, Object> args = new HashMap<>(); args.put("dateRange", dateRange); Window dlg = (Window) PageUtil.createPage(DialogConstants.RESOURCE_PREFIX + "dateRangeDialog.fsp", null, args) .get(...
[ "public", "static", "void", "show", "(", "DateRange", "dateRange", ",", "IResponseCallback", "<", "DateRange", ">", "callback", ")", "{", "Map", "<", "String", ",", "Object", ">", "args", "=", "new", "HashMap", "<>", "(", ")", ";", "args", ".", "put", ...
Displays the date range dialog. @param dateRange The initial date range. @param callback Callback for returning a date range reflecting the inputs from the dialog. This will be null if the input is cancelled or if an unexpected error occurs.
[ "Displays", "the", "date", "range", "dialog", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangeDialog.java#L78-L85
FXMisc/RichTextFX
richtextfx/src/main/java/org/fxmisc/richtext/util/SubscribeableContentsObsSet.java
SubscribeableContentsObsSet.addSubscriber
public Subscription addSubscriber(Function<? super E, Subscription> subscriber) { """ Subscribes to all current and future elements' internal changes in this set until either they are removed or this subscriber is removed by calling {@link Subscription#unsubscribe() unsubscribe} on the function's returned {@link...
java
public Subscription addSubscriber(Function<? super E, Subscription> subscriber) { Objects.requireNonNull(subscriber); subscribers.add(subscriber); List<E> keys = new ArrayList<>(map.keySet()); keys.forEach(key -> { List<Subscription> otherSubs = map.get(key); Sub...
[ "public", "Subscription", "addSubscriber", "(", "Function", "<", "?", "super", "E", ",", "Subscription", ">", "subscriber", ")", "{", "Objects", ".", "requireNonNull", "(", "subscriber", ")", ";", "subscribers", ".", "add", "(", "subscriber", ")", ";", "List...
Subscribes to all current and future elements' internal changes in this set until either they are removed or this subscriber is removed by calling {@link Subscription#unsubscribe() unsubscribe} on the function's returned {@link Subscription}.
[ "Subscribes", "to", "all", "current", "and", "future", "elements", "internal", "changes", "in", "this", "set", "until", "either", "they", "are", "removed", "or", "this", "subscriber", "is", "removed", "by", "calling", "{" ]
train
https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/util/SubscribeableContentsObsSet.java#L106-L119
facebook/fresco
imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java
ImagePipeline.isInDiskCacheSync
public boolean isInDiskCacheSync(final Uri uri, final ImageRequest.CacheChoice cacheChoice) { """ Returns whether the image is stored in the disk cache. Performs disk cache check synchronously. It is not recommended to use this unless you know what exactly you are doing. Disk cache check is a costly operation, ...
java
public boolean isInDiskCacheSync(final Uri uri, final ImageRequest.CacheChoice cacheChoice) { ImageRequest imageRequest = ImageRequestBuilder .newBuilderWithSource(uri) .setCacheChoice(cacheChoice) .build(); return isInDiskCacheSync(imageRequest); }
[ "public", "boolean", "isInDiskCacheSync", "(", "final", "Uri", "uri", ",", "final", "ImageRequest", ".", "CacheChoice", "cacheChoice", ")", "{", "ImageRequest", "imageRequest", "=", "ImageRequestBuilder", ".", "newBuilderWithSource", "(", "uri", ")", ".", "setCacheC...
Returns whether the image is stored in the disk cache. Performs disk cache check synchronously. It is not recommended to use this unless you know what exactly you are doing. Disk cache check is a costly operation, the call will block the caller thread until the cache check is completed. @param uri the uri for the imag...
[ "Returns", "whether", "the", "image", "is", "stored", "in", "the", "disk", "cache", ".", "Performs", "disk", "cache", "check", "synchronously", ".", "It", "is", "not", "recommended", "to", "use", "this", "unless", "you", "know", "what", "exactly", "you", "...
train
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java#L574-L580
dihedron/dihedron-commons
src/main/java/org/dihedron/patterns/activities/TypedVector.java
TypedVector.indexOf
@Override public int indexOf(Object o, int index) { """ Returns the index of the first occurrence of the specified element in this vector, searching forwards from index, or returns -1 if the element is not found. @param o the object to look for. @param index the index from which to start the lookup; it ca...
java
@Override public int indexOf(Object o, int index) { int idx = getRealIndex(index); return super.indexOf(o, idx); }
[ "@", "Override", "public", "int", "indexOf", "(", "Object", "o", ",", "int", "index", ")", "{", "int", "idx", "=", "getRealIndex", "(", "index", ")", ";", "return", "super", ".", "indexOf", "(", "o", ",", "idx", ")", ";", "}" ]
Returns the index of the first occurrence of the specified element in this vector, searching forwards from index, or returns -1 if the element is not found. @param o the object to look for. @param index the index from which to start the lookup; it can be a positive number, or a negative number that is smaller than the...
[ "Returns", "the", "index", "of", "the", "first", "occurrence", "of", "the", "specified", "element", "in", "this", "vector", "searching", "forwards", "from", "index", "or", "returns", "-", "1", "if", "the", "element", "is", "not", "found", "." ]
train
https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/activities/TypedVector.java#L150-L154
web3j/web3j
crypto/src/main/java/org/web3j/crypto/Sign.java
Sign.recoverFromSignature
public static BigInteger recoverFromSignature(int recId, ECDSASignature sig, byte[] message) { """ <p>Given the components of a signature and a selector value, recover and return the public key that generated the signature according to the algorithm in SEC1v2 section 4.1.6.</p> <p>The recId is an index from 0 ...
java
public static BigInteger recoverFromSignature(int recId, ECDSASignature sig, byte[] message) { verifyPrecondition(recId >= 0, "recId must be positive"); verifyPrecondition(sig.r.signum() >= 0, "r must be positive"); verifyPrecondition(sig.s.signum() >= 0, "s must be positive"); verifyPre...
[ "public", "static", "BigInteger", "recoverFromSignature", "(", "int", "recId", ",", "ECDSASignature", "sig", ",", "byte", "[", "]", "message", ")", "{", "verifyPrecondition", "(", "recId", ">=", "0", ",", "\"recId must be positive\"", ")", ";", "verifyPrecondition...
<p>Given the components of a signature and a selector value, recover and return the public key that generated the signature according to the algorithm in SEC1v2 section 4.1.6.</p> <p>The recId is an index from 0 to 3 which indicates which of the 4 possible keys is the correct one. Because the key recovery operation yi...
[ "<p", ">", "Given", "the", "components", "of", "a", "signature", "and", "a", "selector", "value", "recover", "and", "return", "the", "public", "key", "that", "generated", "the", "signature", "according", "to", "the", "algorithm", "in", "SEC1v2", "section", "...
train
https://github.com/web3j/web3j/blob/f99ceb19cdd65895c18e0a565034767ca18ea9fc/crypto/src/main/java/org/web3j/crypto/Sign.java#L114-L170
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.toTimestampBin
public Timestamp toTimestampBin(TimeZone tz, byte[] bytes, boolean timestamptz) throws PSQLException { """ Returns the SQL Timestamp object matching the given bytes with {@link Oid#TIMESTAMP} or {@link Oid#TIMESTAMPTZ}. @param tz The timezone used when received data is {@link Oid#TIMESTAMP}, ignored if d...
java
public Timestamp toTimestampBin(TimeZone tz, byte[] bytes, boolean timestamptz) throws PSQLException { ParsedBinaryTimestamp parsedTimestamp = this.toParsedTimestampBin(tz, bytes, timestamptz); if (parsedTimestamp.infinity == Infinity.POSITIVE) { return new Timestamp(PGStatement.DATE_POSITIVE_INFIN...
[ "public", "Timestamp", "toTimestampBin", "(", "TimeZone", "tz", ",", "byte", "[", "]", "bytes", ",", "boolean", "timestamptz", ")", "throws", "PSQLException", "{", "ParsedBinaryTimestamp", "parsedTimestamp", "=", "this", ".", "toParsedTimestampBin", "(", "tz", ","...
Returns the SQL Timestamp object matching the given bytes with {@link Oid#TIMESTAMP} or {@link Oid#TIMESTAMPTZ}. @param tz The timezone used when received data is {@link Oid#TIMESTAMP}, ignored if data already contains {@link Oid#TIMESTAMPTZ}. @param bytes The binary encoded timestamp value. @param timestamptz True if...
[ "Returns", "the", "SQL", "Timestamp", "object", "matching", "the", "given", "bytes", "with", "{", "@link", "Oid#TIMESTAMP", "}", "or", "{", "@link", "Oid#TIMESTAMPTZ", "}", "." ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L1044-L1057
KyoriPowered/text
api/src/main/java/net/kyori/text/TranslatableComponent.java
TranslatableComponent.of
public static TranslatableComponent of(final @NonNull String key, final @NonNull List<Component> args) { """ Creates a translatable component with a translation key and arguments. @param key the translation key @param args the translation arguments @return the translatable component """ return of(key,...
java
public static TranslatableComponent of(final @NonNull String key, final @NonNull List<Component> args) { return of(key, null, args); }
[ "public", "static", "TranslatableComponent", "of", "(", "final", "@", "NonNull", "String", "key", ",", "final", "@", "NonNull", "List", "<", "Component", ">", "args", ")", "{", "return", "of", "(", "key", ",", "null", ",", "args", ")", ";", "}" ]
Creates a translatable component with a translation key and arguments. @param key the translation key @param args the translation arguments @return the translatable component
[ "Creates", "a", "translatable", "component", "with", "a", "translation", "key", "and", "arguments", "." ]
train
https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/TranslatableComponent.java#L157-L159
looly/hutool
hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java
BeanUtil.isMatchName
public static boolean isMatchName(Object bean, String beanClassName, boolean isSimple) { """ 给定的Bean的类名是否匹配指定类名字符串<br> 如果isSimple为{@code false},则只匹配类名而忽略包名,例如:cn.hutool.TestEntity只匹配TestEntity<br> 如果isSimple为{@code true},则匹配包括包名的全类名,例如:cn.hutool.TestEntity匹配cn.hutool.TestEntity @param bean Bean @param beanCl...
java
public static boolean isMatchName(Object bean, String beanClassName, boolean isSimple) { return ClassUtil.getClassName(bean, isSimple).equals(isSimple ? StrUtil.upperFirst(beanClassName) : beanClassName); }
[ "public", "static", "boolean", "isMatchName", "(", "Object", "bean", ",", "String", "beanClassName", ",", "boolean", "isSimple", ")", "{", "return", "ClassUtil", ".", "getClassName", "(", "bean", ",", "isSimple", ")", ".", "equals", "(", "isSimple", "?", "St...
给定的Bean的类名是否匹配指定类名字符串<br> 如果isSimple为{@code false},则只匹配类名而忽略包名,例如:cn.hutool.TestEntity只匹配TestEntity<br> 如果isSimple为{@code true},则匹配包括包名的全类名,例如:cn.hutool.TestEntity匹配cn.hutool.TestEntity @param bean Bean @param beanClassName Bean的类名 @param isSimple 是否只匹配类名而忽略包名,true表示忽略包名 @return 是否匹配 @since 4.0.6
[ "给定的Bean的类名是否匹配指定类名字符串<br", ">", "如果isSimple为", "{", "@code", "false", "}", ",则只匹配类名而忽略包名,例如:cn", ".", "hutool", ".", "TestEntity只匹配TestEntity<br", ">", "如果isSimple为", "{", "@code", "true", "}", ",则匹配包括包名的全类名,例如:cn", ".", "hutool", ".", "TestEntity匹配cn", ".", "hutool"...
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L635-L637
trellis-ldp/trellis
core/http/src/main/java/org/trellisldp/http/impl/PutHandler.java
PutHandler.setResource
public CompletionStage<ResponseBuilder> setResource(final ResponseBuilder builder) { """ Store the resource to the persistence layer. @param builder the response builder @return the response builder """ LOGGER.debug("Setting resource as {}", getIdentifier()); final IRI ldpType = getLdpType()...
java
public CompletionStage<ResponseBuilder> setResource(final ResponseBuilder builder) { LOGGER.debug("Setting resource as {}", getIdentifier()); final IRI ldpType = getLdpType(); // Verify that the persistence layer supports the given interaction model if (!supportsInteractionModel(ldpTyp...
[ "public", "CompletionStage", "<", "ResponseBuilder", ">", "setResource", "(", "final", "ResponseBuilder", "builder", ")", "{", "LOGGER", ".", "debug", "(", "\"Setting resource as {}\"", ",", "getIdentifier", "(", ")", ")", ";", "final", "IRI", "ldpType", "=", "g...
Store the resource to the persistence layer. @param builder the response builder @return the response builder
[ "Store", "the", "resource", "to", "the", "persistence", "layer", "." ]
train
https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/PutHandler.java#L155-L183
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addRemoveVersion
public void addRemoveVersion(String source, String name, String value, boolean regex, Confidence confidence) { """ Adds a given version to the list of evidence to remove when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param r...
java
public void addRemoveVersion(String source, String name, String value, boolean regex, Confidence confidence) { removeVersion.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
[ "public", "void", "addRemoveVersion", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "boolean", "regex", ",", "Confidence", "confidence", ")", "{", "removeVersion", ".", "add", "(", "new", "EvidenceMatcher", "(", "source", ",", ...
Adds a given version to the list of evidence to remove when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param regex whether value is a regex @param confidence the confidence of the evidence
[ "Adds", "a", "given", "version", "to", "the", "list", "of", "evidence", "to", "remove", "when", "matched", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L253-L255
Alluxio/alluxio
core/server/master/src/main/java/alluxio/underfs/MasterUfsManager.java
MasterUfsManager.setUfsMode
public synchronized void setUfsMode(Supplier<JournalContext> journalContext, AlluxioURI ufsPath, UfsMode ufsMode) throws InvalidPathException { """ Set the operation mode the given physical ufs. @param journalContext the journal context @param ufsPath the physical ufs path (scheme and authority only) @p...
java
public synchronized void setUfsMode(Supplier<JournalContext> journalContext, AlluxioURI ufsPath, UfsMode ufsMode) throws InvalidPathException { LOG.info("Set ufs mode for {} to {}", ufsPath, ufsMode); String root = ufsPath.getRootPath(); if (!mUfsRoots.contains(root)) { LOG.warn("No managed ufs...
[ "public", "synchronized", "void", "setUfsMode", "(", "Supplier", "<", "JournalContext", ">", "journalContext", ",", "AlluxioURI", "ufsPath", ",", "UfsMode", "ufsMode", ")", "throws", "InvalidPathException", "{", "LOG", ".", "info", "(", "\"Set ufs mode for {} to {}\""...
Set the operation mode the given physical ufs. @param journalContext the journal context @param ufsPath the physical ufs path (scheme and authority only) @param ufsMode the ufs operation mode @throws InvalidPathException if no managed ufs covers the given path
[ "Set", "the", "operation", "mode", "the", "given", "physical", "ufs", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/underfs/MasterUfsManager.java#L110-L124
opsmatters/newrelic-api
src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java
HttpContext.PATCH
public void PATCH(String partialUrl, Object payload) { """ Execute a PATCH call against the partial URL. @param partialUrl The partial URL to build @param payload The object to use for the PATCH """ URI uri = buildUri(partialUrl); executePatchRequest(uri, payload); }
java
public void PATCH(String partialUrl, Object payload) { URI uri = buildUri(partialUrl); executePatchRequest(uri, payload); }
[ "public", "void", "PATCH", "(", "String", "partialUrl", ",", "Object", "payload", ")", "{", "URI", "uri", "=", "buildUri", "(", "partialUrl", ")", ";", "executePatchRequest", "(", "uri", ",", "payload", ")", ";", "}" ]
Execute a PATCH call against the partial URL. @param partialUrl The partial URL to build @param payload The object to use for the PATCH
[ "Execute", "a", "PATCH", "call", "against", "the", "partial", "URL", "." ]
train
https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L247-L251
sarl/sarl
docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java
Reflect.setField
public static void setField(Object instance, Class<?> type, String fieldName, Object fieldValue) { """ Change the field. @param instance the instance to change. @param type the type in which the field is declared. @param fieldName the name of the field. @param fieldValue the value of the field. """ try...
java
public static void setField(Object instance, Class<?> type, String fieldName, Object fieldValue) { try { final Field field = type.getDeclaredField(fieldName); field.setAccessible(true); field.set(instance, fieldValue); } catch (Exception exception) { throw new Error(exception); } }
[ "public", "static", "void", "setField", "(", "Object", "instance", ",", "Class", "<", "?", ">", "type", ",", "String", "fieldName", ",", "Object", "fieldValue", ")", "{", "try", "{", "final", "Field", "field", "=", "type", ".", "getDeclaredField", "(", "...
Change the field. @param instance the instance to change. @param type the type in which the field is declared. @param fieldName the name of the field. @param fieldValue the value of the field.
[ "Change", "the", "field", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java#L59-L67
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/geom/RoundedRectangle.java
RoundedRectangle.createPoints
private List createPoints(int numberOfSegments, float radius, float cx, float cy, float start, float end) { """ Generate the points to fill a corner arc. @param numberOfSegments How fine to make the ellipse. @param radius The radius of the arc. @param cx The x center of the arc. @param cy The y center of the...
java
private List createPoints(int numberOfSegments, float radius, float cx, float cy, float start, float end) { ArrayList tempPoints = new ArrayList(); int step = 360 / numberOfSegments; for (float a=start;a<=end+step;a+=step) { float ang = a; if (ang > end) ...
[ "private", "List", "createPoints", "(", "int", "numberOfSegments", ",", "float", "radius", ",", "float", "cx", ",", "float", "cy", ",", "float", "start", ",", "float", "end", ")", "{", "ArrayList", "tempPoints", "=", "new", "ArrayList", "(", ")", ";", "i...
Generate the points to fill a corner arc. @param numberOfSegments How fine to make the ellipse. @param radius The radius of the arc. @param cx The x center of the arc. @param cy The y center of the arc. @param start The start angle of the arc. @param end The end angle of the arc. @return The points created.
[ "Generate", "the", "points", "to", "fill", "a", "corner", "arc", "." ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/RoundedRectangle.java#L245-L263
javabeanz/owasp-security-logging
owasp-security-logging-common/src/main/java/org/owasp/security/logging/util/SecurityUtil.java
SecurityUtil.bindSystemStreamsToSLF4J
public static void bindSystemStreamsToSLF4J(Logger sysOutLogger, Logger sysErrLogger) { """ Redirect <code>System.out</code> and <code>System.err</code> streams to the given SLF4J loggers. This is a benefit if you have a legacy console logger application. Does not provide benefit of a full implementation. For ...
java
public static void bindSystemStreamsToSLF4J(Logger sysOutLogger, Logger sysErrLogger) { SecurityUtil.sysOutLogger = sysOutLogger; SecurityUtil.sysErrLogger = sysErrLogger; bindSystemStreamsToSLF4J(); }
[ "public", "static", "void", "bindSystemStreamsToSLF4J", "(", "Logger", "sysOutLogger", ",", "Logger", "sysErrLogger", ")", "{", "SecurityUtil", ".", "sysOutLogger", "=", "sysOutLogger", ";", "SecurityUtil", ".", "sysErrLogger", "=", "sysErrLogger", ";", "bindSystemStr...
Redirect <code>System.out</code> and <code>System.err</code> streams to the given SLF4J loggers. This is a benefit if you have a legacy console logger application. Does not provide benefit of a full implementation. For example, no hierarchical or logger inheritence support but there are some ancilarity benefits like,...
[ "Redirect", "<code", ">", "System", ".", "out<", "/", "code", ">", "and", "<code", ">", "System", ".", "err<", "/", "code", ">", "streams", "to", "the", "given", "SLF4J", "loggers", ".", "This", "is", "a", "benefit", "if", "you", "have", "a", "legacy...
train
https://github.com/javabeanz/owasp-security-logging/blob/060dcb1ab5f62aaea274597418ce41c8433a6c10/owasp-security-logging-common/src/main/java/org/owasp/security/logging/util/SecurityUtil.java#L53-L57
mikepenz/Materialize
library/src/main/java/com/mikepenz/materialize/util/UIUtils.java
UIUtils.getThemeColorFromAttrOrRes
public static int getThemeColorFromAttrOrRes(Context ctx, @AttrRes int attr, @ColorRes int res) { """ helper method to get the color by attr (which is defined in the style) or by resource. @param ctx @param attr @param res @return """ int color = getThemeColor(ctx, attr); if (color == 0) ...
java
public static int getThemeColorFromAttrOrRes(Context ctx, @AttrRes int attr, @ColorRes int res) { int color = getThemeColor(ctx, attr); if (color == 0) { color = ResourcesCompat.getColor(ctx.getResources(), res, ctx.getTheme()); } return color; }
[ "public", "static", "int", "getThemeColorFromAttrOrRes", "(", "Context", "ctx", ",", "@", "AttrRes", "int", "attr", ",", "@", "ColorRes", "int", "res", ")", "{", "int", "color", "=", "getThemeColor", "(", "ctx", ",", "attr", ")", ";", "if", "(", "color",...
helper method to get the color by attr (which is defined in the style) or by resource. @param ctx @param attr @param res @return
[ "helper", "method", "to", "get", "the", "color", "by", "attr", "(", "which", "is", "defined", "in", "the", "style", ")", "or", "by", "resource", "." ]
train
https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/util/UIUtils.java#L55-L61
kuali/ojb-1.0.4
src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java
OjbTagsHandler.getPropertyValue
private String getPropertyValue(String level, String name) { """ Returns the value of the indicated property of the current object on the specified level. @param level The level @param name The name of the property @return The property value """ return getDefForLevel(level).getProperty(n...
java
private String getPropertyValue(String level, String name) { return getDefForLevel(level).getProperty(name); }
[ "private", "String", "getPropertyValue", "(", "String", "level", ",", "String", "name", ")", "{", "return", "getDefForLevel", "(", "level", ")", ".", "getProperty", "(", "name", ")", ";", "}" ]
Returns the value of the indicated property of the current object on the specified level. @param level The level @param name The name of the property @return The property value
[ "Returns", "the", "value", "of", "the", "indicated", "property", "of", "the", "current", "object", "on", "the", "specified", "level", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L1901-L1904
redkale/redkale
src/org/redkale/source/EntityInfo.java
EntityInfo.isLoggable
public boolean isLoggable(Logger logger, Level l, String str) { """ 判断日志级别 @param logger Logger @param l Level @param str String @return boolean """ boolean rs = logger.isLoggable(l) && l.intValue() >= this.logLevel; if (this.excludeLogLevels == null || !rs || str == null) ret...
java
public boolean isLoggable(Logger logger, Level l, String str) { boolean rs = logger.isLoggable(l) && l.intValue() >= this.logLevel; if (this.excludeLogLevels == null || !rs || str == null) return rs; String[] keys = this.excludeLogLevels.get(l.intValue()); if (keys == null) return rs...
[ "public", "boolean", "isLoggable", "(", "Logger", "logger", ",", "Level", "l", ",", "String", "str", ")", "{", "boolean", "rs", "=", "logger", ".", "isLoggable", "(", "l", ")", "&&", "l", ".", "intValue", "(", ")", ">=", "this", ".", "logLevel", ";",...
判断日志级别 @param logger Logger @param l Level @param str String @return boolean
[ "判断日志级别" ]
train
https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/EntityInfo.java#L1006-L1015
ggrandes/kvstore
src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java
BplusTree.putIterative
protected Node<K, V> putIterative(final K key, final V value) throws DuplicateKeyException { """ Put the key/value in the tree (this function is iterative) If root node is split by this operation then the return value is the Node that was created when root node was split @param key the key to add @param va...
java
protected Node<K, V> putIterative(final K key, final V value) throws DuplicateKeyException { final LeafNode<K, V> nodeLeaf = findLeafNode(key, true); if (nodeLeaf == null) { final StringBuilder sb = new StringBuilder(); while (!stackNodes.isEmpty()) { sb.append("\n").append(stackNodes.pop()); } thro...
[ "protected", "Node", "<", "K", ",", "V", ">", "putIterative", "(", "final", "K", "key", ",", "final", "V", "value", ")", "throws", "DuplicateKeyException", "{", "final", "LeafNode", "<", "K", ",", "V", ">", "nodeLeaf", "=", "findLeafNode", "(", "key", ...
Put the key/value in the tree (this function is iterative) If root node is split by this operation then the return value is the Node that was created when root node was split @param key the key to add @param value the value to add @return a new node that was created when root node was split, or null if u was not spli...
[ "Put", "the", "key", "/", "value", "in", "the", "tree", "(", "this", "function", "is", "iterative", ")" ]
train
https://github.com/ggrandes/kvstore/blob/c79277f79f4604e0fec8349a98519838e3de38f0/src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java#L1035-L1074
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/CassandraAuthorizer.java
CassandraAuthorizer.modify
private void modify(Set<Permission> permissions, IResource resource, String user, String op) throws RequestExecutionException { """ Adds or removes permissions from user's 'permissions' set (adds if op is "+", removes if op is "-") """ process(String.format("UPDATE %s.%s SET permissions = permissions %...
java
private void modify(Set<Permission> permissions, IResource resource, String user, String op) throws RequestExecutionException { process(String.format("UPDATE %s.%s SET permissions = permissions %s {%s} WHERE username = '%s' AND resource = '%s'", Auth.AUTH_KS, ...
[ "private", "void", "modify", "(", "Set", "<", "Permission", ">", "permissions", ",", "IResource", "resource", ",", "String", "user", ",", "String", "op", ")", "throws", "RequestExecutionException", "{", "process", "(", "String", ".", "format", "(", "\"UPDATE %...
Adds or removes permissions from user's 'permissions' set (adds if op is "+", removes if op is "-")
[ "Adds", "or", "removes", "permissions", "from", "user", "s", "permissions", "set", "(", "adds", "if", "op", "is", "+", "removes", "if", "op", "is", "-", ")" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java#L111-L120
matthewhorridge/owlapi-gwt
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/util/OWLAPIPreconditions.java
OWLAPIPreconditions.checkNotNull
@Nonnull public static <T> T checkNotNull(Optional<T> object, @Nonnull String message) { """ check for absent and throw IllegalArgumentException if null or absent @param object reference to check @param message message for the illegal argument exception @param <T> reference type @return th...
java
@Nonnull public static <T> T checkNotNull(Optional<T> object, @Nonnull String message) { if (object == null || !object.isPresent()) { throw new IllegalArgumentException(message); } return verifyNotNull(object.get()); }
[ "@", "Nonnull", "public", "static", "<", "T", ">", "T", "checkNotNull", "(", "Optional", "<", "T", ">", "object", ",", "@", "Nonnull", "String", "message", ")", "{", "if", "(", "object", "==", "null", "||", "!", "object", ".", "isPresent", "(", ")", ...
check for absent and throw IllegalArgumentException if null or absent @param object reference to check @param message message for the illegal argument exception @param <T> reference type @return the input reference if not null @throws IllegalArgumentException if object is null
[ "check", "for", "absent", "and", "throw", "IllegalArgumentException", "if", "null", "or", "absent" ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/util/OWLAPIPreconditions.java#L145-L152
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/util/TransparentReplicaGetHelper.java
TransparentReplicaGetHelper.getFirstPrimaryOrReplica
@InterfaceStability.Experimental @InterfaceAudience.Public public Single<JsonDocument> getFirstPrimaryOrReplica(final String id, final Bucket bucket, final long timeout) { """ Asynchronously fetch the document from the primary and if that operations fails try all the replicas and return the first ...
java
@InterfaceStability.Experimental @InterfaceAudience.Public public Single<JsonDocument> getFirstPrimaryOrReplica(final String id, final Bucket bucket, final long timeout) { return getFirstPrimaryOrReplica(id, bucket, timeout, timeout); }
[ "@", "InterfaceStability", ".", "Experimental", "@", "InterfaceAudience", ".", "Public", "public", "Single", "<", "JsonDocument", ">", "getFirstPrimaryOrReplica", "(", "final", "String", "id", ",", "final", "Bucket", "bucket", ",", "final", "long", "timeout", ")",...
Asynchronously fetch the document from the primary and if that operations fails try all the replicas and return the first document that comes back from them (with a custom timeout value applied to both primary and replica). @param id the document ID to fetch. @param bucket the bucket to use when fetching the doc. @par...
[ "Asynchronously", "fetch", "the", "document", "from", "the", "primary", "and", "if", "that", "operations", "fails", "try", "all", "the", "replicas", "and", "return", "the", "first", "document", "that", "comes", "back", "from", "them", "(", "with", "a", "cust...
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/util/TransparentReplicaGetHelper.java#L71-L76
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/attribute/TimestampAttributeAsOfAttributeToInfiniteNull.java
TimestampAttributeAsOfAttributeToInfiniteNull.setAll
public void setAll(String attributeName, String busClassNameWithDots, String busClassName, boolean isNullable, RelatedFinder relatedFinder, Map properties, boolean transactional) { """ /* public Operation eq(Object other) { return timestampAttribute.eq(other); } public Operation notEq(Object other) { retu...
java
public void setAll(String attributeName, String busClassNameWithDots, String busClassName, boolean isNullable, RelatedFinder relatedFinder, Map properties, boolean transactional) { timestampAttribute.setAll(attributeName, busClassNameWithDots, busClassName, isNullable, relatedFinder, properties, transacti...
[ "public", "void", "setAll", "(", "String", "attributeName", ",", "String", "busClassNameWithDots", ",", "String", "busClassName", ",", "boolean", "isNullable", ",", "RelatedFinder", "relatedFinder", ",", "Map", "properties", ",", "boolean", "transactional", ")", "{"...
/* public Operation eq(Object other) { return timestampAttribute.eq(other); } public Operation notEq(Object other) { return timestampAttribute.notEq(other); }
[ "/", "*", "public", "Operation", "eq", "(", "Object", "other", ")", "{", "return", "timestampAttribute", ".", "eq", "(", "other", ")", ";", "}" ]
train
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/attribute/TimestampAttributeAsOfAttributeToInfiniteNull.java#L457-L460
netty/netty-tcnative
openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSLContext.java
SSLContext.setCipherSuite
@Deprecated public static boolean setCipherSuite(long ctx, String ciphers) throws Exception { """ Cipher Suite available for negotiation in SSL handshake. <br> This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to configure the Cipher Suite the clien...
java
@Deprecated public static boolean setCipherSuite(long ctx, String ciphers) throws Exception { return setCipherSuite(ctx, ciphers, false); }
[ "@", "Deprecated", "public", "static", "boolean", "setCipherSuite", "(", "long", "ctx", ",", "String", "ciphers", ")", "throws", "Exception", "{", "return", "setCipherSuite", "(", "ctx", ",", "ciphers", ",", "false", ")", ";", "}" ]
Cipher Suite available for negotiation in SSL handshake. <br> This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this directive can be used both in per-ser...
[ "Cipher", "Suite", "available", "for", "negotiation", "in", "SSL", "handshake", ".", "<br", ">", "This", "complex", "directive", "uses", "a", "colon", "-", "separated", "cipher", "-", "spec", "string", "consisting", "of", "OpenSSL", "cipher", "specifications", ...
train
https://github.com/netty/netty-tcnative/blob/4a5d7330c6c36cff2bebbb465571cab1cf7a4063/openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSLContext.java#L115-L118
apptik/jus
jus-java/src/main/java/io/apptik/comm/jus/http/DateUtils.java
DateUtils.formatDate
public static String formatDate(Date date, String pattern) { """ Formats the given date according to the specified pattern. The pattern must conform to that used by the {@link SimpleDateFormat simple date format} class. @param date The date to format. @param pattern The pattern to use for formatting the dat...
java
public static String formatDate(Date date, String pattern) { if (date == null) throw new IllegalArgumentException("date is null"); if (pattern == null) throw new IllegalArgumentException("pattern is null"); SimpleDateFormat formatter = DateFormatHolder.formatFor(pattern); return formatt...
[ "public", "static", "String", "formatDate", "(", "Date", "date", ",", "String", "pattern", ")", "{", "if", "(", "date", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"date is null\"", ")", ";", "if", "(", "pattern", "==", "null", ")...
Formats the given date according to the specified pattern. The pattern must conform to that used by the {@link SimpleDateFormat simple date format} class. @param date The date to format. @param pattern The pattern to use for formatting the date. @return A formatted date string. @throws IllegalArgumentException If th...
[ "Formats", "the", "given", "date", "according", "to", "the", "specified", "pattern", ".", "The", "pattern", "must", "conform", "to", "that", "used", "by", "the", "{", "@link", "SimpleDateFormat", "simple", "date", "format", "}", "class", "." ]
train
https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/http/DateUtils.java#L214-L220
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java
FactoryDescribeRegionPoint.surfColorFast
public static <T extends ImageMultiBand<T>, II extends ImageGray<II>> DescribeRegionPoint<T,BrightFeature> surfColorFast(@Nullable ConfigSurfDescribe.Speed config , ImageType<T> imageType) { """ Color variant of the SURF descriptor which has been designed for speed and sacrifices some stability. @see DescribeP...
java
public static <T extends ImageMultiBand<T>, II extends ImageGray<II>> DescribeRegionPoint<T,BrightFeature> surfColorFast(@Nullable ConfigSurfDescribe.Speed config , ImageType<T> imageType) { Class bandType = imageType.getImageClass(); Class<II> integralType = GIntegralImageOps.getIntegralType(bandType); Descri...
[ "public", "static", "<", "T", "extends", "ImageMultiBand", "<", "T", ">", ",", "II", "extends", "ImageGray", "<", "II", ">", ">", "DescribeRegionPoint", "<", "T", ",", "BrightFeature", ">", "surfColorFast", "(", "@", "Nullable", "ConfigSurfDescribe", ".", "S...
Color variant of the SURF descriptor which has been designed for speed and sacrifices some stability. @see DescribePointSurfPlanar @param config SURF configuration. Pass in null for default options. @param imageType Type of input image. @return SURF color description extractor
[ "Color", "variant", "of", "the", "SURF", "descriptor", "which", "has", "been", "designed", "for", "speed", "and", "sacrifices", "some", "stability", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java#L78-L93
SimiaCryptus/utilities
java-util/src/main/java/com/simiacryptus/util/StreamNanoHTTPD.java
StreamNanoHTTPD.addAsyncHandler
public void addAsyncHandler(final String path, final String mimeType, @javax.annotation.Nonnull final Consumer<OutputStream> logic, final boolean async) { """ Add async handler. @param path the path @param mimeType the mime type @param logic the logic @param async the async """ addSessionHa...
java
public void addAsyncHandler(final String path, final String mimeType, @javax.annotation.Nonnull final Consumer<OutputStream> logic, final boolean async) { addSessionHandler(path, com.simiacryptus.util.StreamNanoHTTPD.asyncHandler(pool, mimeType, logic, async)); }
[ "public", "void", "addAsyncHandler", "(", "final", "String", "path", ",", "final", "String", "mimeType", ",", "@", "javax", ".", "annotation", ".", "Nonnull", "final", "Consumer", "<", "OutputStream", ">", "logic", ",", "final", "boolean", "async", ")", "{",...
Add async handler. @param path the path @param mimeType the mime type @param logic the logic @param async the async
[ "Add", "async", "handler", "." ]
train
https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/StreamNanoHTTPD.java#L175-L177
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ReflectionUtils.java
ReflectionUtils.getFieldNameByGetter
static String getFieldNameByGetter(Method getter, boolean forceCamelCase) { """ Returns the field name that corresponds to the given getter method, according to the Java naming convention. @param getter The getter method. @param forceCamelCase True if the returned field name should be in camel-case, i.e. t...
java
static String getFieldNameByGetter(Method getter, boolean forceCamelCase) { String getterName = getter.getName(); String fieldNameWithUpperCamelCase = ""; if ( getterName.startsWith("get") ) { fieldNameWithUpperCamelCase = getterName.substring("get".length()); } else if ( ge...
[ "static", "String", "getFieldNameByGetter", "(", "Method", "getter", ",", "boolean", "forceCamelCase", ")", "{", "String", "getterName", "=", "getter", ".", "getName", "(", ")", ";", "String", "fieldNameWithUpperCamelCase", "=", "\"\"", ";", "if", "(", "getterNa...
Returns the field name that corresponds to the given getter method, according to the Java naming convention. @param getter The getter method. @param forceCamelCase True if the returned field name should be in camel-case, i.e. the first letter is lower-cased.
[ "Returns", "the", "field", "name", "that", "corresponds", "to", "the", "given", "getter", "method", "according", "to", "the", "Java", "naming", "convention", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ReflectionUtils.java#L40-L62
JOML-CI/JOML
src/org/joml/Vector4i.java
Vector4i.distanceSquared
public static long distanceSquared(int x1, int y1, int z1, int w1, int x2, int y2, int z2, int w2) { """ Return the squared distance between <code>(x1, y1, z1, w1)</code> and <code>(x2, y2, z2, w2)</code>. @param x1 the x component of the first vector @param y1 the y component of the first vector @param z1 ...
java
public static long distanceSquared(int x1, int y1, int z1, int w1, int x2, int y2, int z2, int w2) { int dx = x1 - x2; int dy = y1 - y2; int dz = z1 - z2; int dw = w1 - w2; return dx * dx + dy * dy + dz * dz + dw * dw; }
[ "public", "static", "long", "distanceSquared", "(", "int", "x1", ",", "int", "y1", ",", "int", "z1", ",", "int", "w1", ",", "int", "x2", ",", "int", "y2", ",", "int", "z2", ",", "int", "w2", ")", "{", "int", "dx", "=", "x1", "-", "x2", ";", "...
Return the squared distance between <code>(x1, y1, z1, w1)</code> and <code>(x2, y2, z2, w2)</code>. @param x1 the x component of the first vector @param y1 the y component of the first vector @param z1 the z component of the first vector @param w1 the w component of the first vector @param x2 the x component of the s...
[ "Return", "the", "squared", "distance", "between", "<code", ">", "(", "x1", "y1", "z1", "w1", ")", "<", "/", "code", ">", "and", "<code", ">", "(", "x2", "y2", "z2", "w2", ")", "<", "/", "code", ">", "." ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4i.java#L881-L887
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java
AbstractCreator.methodCallCodeWithJMapperTypeParameters
private CodeBlock methodCallCodeWithJMapperTypeParameters( CodeBlock.Builder builder, ImmutableList<? extends JMapperType> parameters ) { """ Build the code for the parameters of a method call. @param builder the code builder @param parameters the parameters @return the code """ return metho...
java
private CodeBlock methodCallCodeWithJMapperTypeParameters( CodeBlock.Builder builder, ImmutableList<? extends JMapperType> parameters ) { return methodCallParametersCode( builder, Lists.transform( parameters, new Function<JMapperType, CodeBlock>() { @Override public CodeBlock apply(...
[ "private", "CodeBlock", "methodCallCodeWithJMapperTypeParameters", "(", "CodeBlock", ".", "Builder", "builder", ",", "ImmutableList", "<", "?", "extends", "JMapperType", ">", "parameters", ")", "{", "return", "methodCallParametersCode", "(", "builder", ",", "Lists", "...
Build the code for the parameters of a method call. @param builder the code builder @param parameters the parameters @return the code
[ "Build", "the", "code", "for", "the", "parameters", "of", "a", "method", "call", "." ]
train
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java#L930-L939
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/UrlValidator.java
UrlValidator.isValid
@Override public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) { """ {@inheritDoc} check if given string is a valid url. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext) """ if (StringUtils.isEmpty...
java
@Override public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) { if (StringUtils.isEmpty(pvalue)) { return true; } if (pvalue.length() > LENGTH_URL) { // url is to long, but that's handled by size annotation return true; } return org.apache...
[ "@", "Override", "public", "final", "boolean", "isValid", "(", "final", "String", "pvalue", ",", "final", "ConstraintValidatorContext", "pcontext", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "pvalue", ")", ")", "{", "return", "true", ";", "}", ...
{@inheritDoc} check if given string is a valid url. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
[ "{", "@inheritDoc", "}", "check", "if", "given", "string", "is", "a", "valid", "url", "." ]
train
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/UrlValidator.java#L54-L64
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/cdn/CdnClient.java
CdnClient.getDomainCacheTTL
public GetDomainCacheTTLResponse getDomainCacheTTL(GetDomainCacheTTLRequest request) { """ Get cache policies of specified domain acceleration. @param request The request containing all of the options related to the domain. @return Detailed information about cache policies. """ checkNotNull(request...
java
public GetDomainCacheTTLResponse getDomainCacheTTL(GetDomainCacheTTLRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(request, HttpMethodName.GET, DOMAIN, request.getDomain(), "config"); internalRequest.addParam...
[ "public", "GetDomainCacheTTLResponse", "getDomainCacheTTL", "(", "GetDomainCacheTTLRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"The parameter request should NOT be null.\"", ")", ";", "InternalRequest", "internalRequest", "=", "createRequest", "(", "...
Get cache policies of specified domain acceleration. @param request The request containing all of the options related to the domain. @return Detailed information about cache policies.
[ "Get", "cache", "policies", "of", "specified", "domain", "acceleration", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L343-L348
jcuda/jcudnn
JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java
JCudnn.cudnnBatchNormalizationForwardTraining
public static int cudnnBatchNormalizationForwardTraining( cudnnHandle handle, int mode, Pointer alpha, /** alpha[0] = result blend factor */ Pointer beta, /** beta[0] = dest layer blend factor */ cudnnTensorDescriptor xDesc, Pointer x, /** NxCxHxW */ cudnnTenso...
java
public static int cudnnBatchNormalizationForwardTraining( cudnnHandle handle, int mode, Pointer alpha, /** alpha[0] = result blend factor */ Pointer beta, /** beta[0] = dest layer blend factor */ cudnnTensorDescriptor xDesc, Pointer x, /** NxCxHxW */ cudnnTenso...
[ "public", "static", "int", "cudnnBatchNormalizationForwardTraining", "(", "cudnnHandle", "handle", ",", "int", "mode", ",", "Pointer", "alpha", ",", "/** alpha[0] = result blend factor */", "Pointer", "beta", ",", "/** beta[0] = dest layer blend factor */", "cudnnTensorDescript...
Computes y = BN(x). Also accumulates moving averages of mean and inverse variances
[ "Computes", "y", "=", "BN", "(", "x", ")", ".", "Also", "accumulates", "moving", "averages", "of", "mean", "and", "inverse", "variances" ]
train
https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L2274-L2325
jenkinsci/jenkins
core/src/main/java/hudson/util/NoClientBindProtocolSocketFactory.java
NoClientBindProtocolSocketFactory.createSocket
public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException { """ Attempts to get a new socket connection to the given host within the given time limit. <p> This m...
java
public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException { if (params == null) { throw new IllegalArgumentException("Parameters may not be null"); ...
[ "public", "Socket", "createSocket", "(", "String", "host", ",", "int", "port", ",", "InetAddress", "localAddress", ",", "int", "localPort", ",", "HttpConnectionParams", "params", ")", "throws", "IOException", ",", "UnknownHostException", ",", "ConnectTimeoutException"...
Attempts to get a new socket connection to the given host within the given time limit. <p> This method employs several techniques to circumvent the limitations of older JREs that do not support connect timeout. When running in JRE 1.4 or above reflection is used to call Socket#connect(SocketAddress endpoint, int timeou...
[ "Attempts", "to", "get", "a", "new", "socket", "connection", "to", "the", "given", "host", "within", "the", "given", "time", "limit", ".", "<p", ">", "This", "method", "employs", "several", "techniques", "to", "circumvent", "the", "limitations", "of", "older...
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/NoClientBindProtocolSocketFactory.java#L81-L96
jaxio/celerio
celerio-engine/src/main/java/com/jaxio/celerio/factory/RelationCollisionUtil.java
RelationCollisionUtil.getOneToManyNamer
public Namer getOneToManyNamer(ColumnConfig fromAttributeColumnConfig, Namer fromEntityNamer) { """ Compute the appropriate namer for the Java field marked by @OneToMany @param fromAttributeColumnConfig the column that is the foreign key @param fromEntityNamer the default namer for the entity contain...
java
public Namer getOneToManyNamer(ColumnConfig fromAttributeColumnConfig, Namer fromEntityNamer) { // configuration Namer result = getOneToManyNamerFromConf(fromAttributeColumnConfig.getOneToManyConfig(), fromEntityNamer); // convention if (result == null) { result = fromEntity...
[ "public", "Namer", "getOneToManyNamer", "(", "ColumnConfig", "fromAttributeColumnConfig", ",", "Namer", "fromEntityNamer", ")", "{", "// configuration", "Namer", "result", "=", "getOneToManyNamerFromConf", "(", "fromAttributeColumnConfig", ".", "getOneToManyConfig", "(", ")...
Compute the appropriate namer for the Java field marked by @OneToMany @param fromAttributeColumnConfig the column that is the foreign key @param fromEntityNamer the default namer for the entity contained in the collection.
[ "Compute", "the", "appropriate", "namer", "for", "the", "Java", "field", "marked", "by", "@OneToMany" ]
train
https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/factory/RelationCollisionUtil.java#L74-L84
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java
BoofMiscOps.checkInside
public static boolean checkInside(ImageBase b, int x , int y , int radius ) { """ Returns true if the point is contained inside the image and 'radius' away from the image border. @param b Image @param x x-coordinate of point @param y y-coordinate of point @param radius How many pixels away from the border it...
java
public static boolean checkInside(ImageBase b, int x , int y , int radius ) { if( x-radius < 0 ) return false; if( x+radius >= b.width ) return false; if( y-radius < 0 ) return false; if( y+radius >= b.height ) return false; return true; }
[ "public", "static", "boolean", "checkInside", "(", "ImageBase", "b", ",", "int", "x", ",", "int", "y", ",", "int", "radius", ")", "{", "if", "(", "x", "-", "radius", "<", "0", ")", "return", "false", ";", "if", "(", "x", "+", "radius", ">=", "b",...
Returns true if the point is contained inside the image and 'radius' away from the image border. @param b Image @param x x-coordinate of point @param y y-coordinate of point @param radius How many pixels away from the border it needs to be to be considered inside @return true if the point is inside and false if it is ...
[ "Returns", "true", "if", "the", "point", "is", "contained", "inside", "the", "image", "and", "radius", "away", "from", "the", "image", "border", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L184-L195
zaproxy/zaproxy
src/org/parosproxy/paros/view/AbstractFrame.java
AbstractFrame.restoreWindowSize
private Dimension restoreWindowSize() { """ Loads and set the saved size preferences for this frame. @return the size of the frame OR null, if there wasn't any preference. """ Dimension result = null; final String sizestr = preferences.get(prefnzPrefix+PREF_WINDOW_SIZE, null); if (sizestr != null) ...
java
private Dimension restoreWindowSize() { Dimension result = null; final String sizestr = preferences.get(prefnzPrefix+PREF_WINDOW_SIZE, null); if (sizestr != null) { int width = 0; int height = 0; final String[] sizes = sizestr.split("[,]"); try { width = Integer.parseInt(sizes[0].trim()); ...
[ "private", "Dimension", "restoreWindowSize", "(", ")", "{", "Dimension", "result", "=", "null", ";", "final", "String", "sizestr", "=", "preferences", ".", "get", "(", "prefnzPrefix", "+", "PREF_WINDOW_SIZE", ",", "null", ")", ";", "if", "(", "sizestr", "!="...
Loads and set the saved size preferences for this frame. @return the size of the frame OR null, if there wasn't any preference.
[ "Loads", "and", "set", "the", "saved", "size", "preferences", "for", "this", "frame", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/AbstractFrame.java#L199-L219
ksoichiro/Android-ObservableScrollView
samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FlexibleSpaceWithImageGridViewFragment.java
FlexibleSpaceWithImageGridViewFragment.setSelectionFromTop
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void setSelectionFromTop(ObservableGridView gridView, int position, int offset) { """ /* setSelectionFromTop method has been moved from ListView to AbsListView since API level 21, so for API level 21-, we need to use other method to scroll with offset. smooth...
java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void setSelectionFromTop(ObservableGridView gridView, int position, int offset) { if (Build.VERSION_CODES.LOLLIPOP <= Build.VERSION.SDK_INT) { gridView.setSelectionFromTop(position, offset); } else if (Build.VERSION_CODES.HONEYCOMB <= Buil...
[ "@", "TargetApi", "(", "Build", ".", "VERSION_CODES", ".", "LOLLIPOP", ")", "private", "void", "setSelectionFromTop", "(", "ObservableGridView", "gridView", ",", "int", "position", ",", "int", "offset", ")", "{", "if", "(", "Build", ".", "VERSION_CODES", ".", ...
/* setSelectionFromTop method has been moved from ListView to AbsListView since API level 21, so for API level 21-, we need to use other method to scroll with offset. smoothScrollToPositionFromTop seems to work, but it's from API level 11. We can't use GridView for Gingerbread.
[ "/", "*", "setSelectionFromTop", "method", "has", "been", "moved", "from", "ListView", "to", "AbsListView", "since", "API", "level", "21", "so", "for", "API", "level", "21", "-", "we", "need", "to", "use", "other", "method", "to", "scroll", "with", "offset...
train
https://github.com/ksoichiro/Android-ObservableScrollView/blob/47a5fb2db5e93d923a8c6772cde48bbb7d932345/samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FlexibleSpaceWithImageGridViewFragment.java#L127-L134
jenkinsci/jenkins
core/src/main/java/hudson/scm/RepositoryBrowsers.java
RepositoryBrowsers.createInstance
public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, JSONObject parent, String fieldName) throws FormException { """ Creates an instance of {@link RepositoryBrowser} from a form submission. @since 1.227 """ JSONObject o = (JSONObject)parent.get(fieldNam...
java
public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, JSONObject parent, String fieldName) throws FormException { JSONObject o = (JSONObject)parent.get(fieldName); if(o==null) return null; return req.bindJSON(type,o); }
[ "public", "static", "<", "T", "extends", "RepositoryBrowser", ">", "T", "createInstance", "(", "Class", "<", "T", ">", "type", ",", "StaplerRequest", "req", ",", "JSONObject", "parent", ",", "String", "fieldName", ")", "throws", "FormException", "{", "JSONObje...
Creates an instance of {@link RepositoryBrowser} from a form submission. @since 1.227
[ "Creates", "an", "instance", "of", "{", "@link", "RepositoryBrowser", "}", "from", "a", "form", "submission", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/RepositoryBrowsers.java#L88-L94
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/CachedPrintQuery.java
CachedPrintQuery.get4Request
public static CachedPrintQuery get4Request(final Instance _instance) throws EFapsException { """ Get a CachedPrintQuery that will only cache during a request. @param _instance instance to be updated. @return the 4 request @throws EFapsException on error """ return new CachedPrintQuery(_ins...
java
public static CachedPrintQuery get4Request(final Instance _instance) throws EFapsException { return new CachedPrintQuery(_instance, Context.getThreadContext().getRequestId()).setLifespan(5) .setLifespanUnit(TimeUnit.MINUTES); }
[ "public", "static", "CachedPrintQuery", "get4Request", "(", "final", "Instance", "_instance", ")", "throws", "EFapsException", "{", "return", "new", "CachedPrintQuery", "(", "_instance", ",", "Context", ".", "getThreadContext", "(", ")", ".", "getRequestId", "(", ...
Get a CachedPrintQuery that will only cache during a request. @param _instance instance to be updated. @return the 4 request @throws EFapsException on error
[ "Get", "a", "CachedPrintQuery", "that", "will", "only", "cache", "during", "a", "request", "." ]
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/CachedPrintQuery.java#L194-L199
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java
URBridge.setConfigEntityMapping
private void setConfigEntityMapping(Map<String, Object> configProps) throws WIMException { """ Set the mapping of RDN properties for each entity type. A map is created with the key as the entity type and the value as the RDN property to be used. This information is taken from the configuration. @param configP...
java
private void setConfigEntityMapping(Map<String, Object> configProps) throws WIMException { List<String> entityTypes = getSupportedEntityTypes(); String rdnProp; String type = null; entityConfigMap = new HashMap<String, String>(); for (int i = 0; i < entityTypes.size(); i++) { ...
[ "private", "void", "setConfigEntityMapping", "(", "Map", "<", "String", ",", "Object", ">", "configProps", ")", "throws", "WIMException", "{", "List", "<", "String", ">", "entityTypes", "=", "getSupportedEntityTypes", "(", ")", ";", "String", "rdnProp", ";", "...
Set the mapping of RDN properties for each entity type. A map is created with the key as the entity type and the value as the RDN property to be used. This information is taken from the configuration. @param configProps map containing the configuration information. @throws WIMException throw when there is not a mappi...
[ "Set", "the", "mapping", "of", "RDN", "properties", "for", "each", "entity", "type", ".", "A", "map", "is", "created", "with", "the", "key", "as", "the", "entity", "type", "and", "the", "value", "as", "the", "RDN", "property", "to", "be", "used", ".", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java#L345-L360
williamwebb/alogger
BillingHelper/src/main/java/com/jug6ernaut/billing/IabHelper.java
IabHelper.consumeAsync
public void consumeAsync(List<Purchase> purchases, OnConsumeMultiFinishedListener listener) { """ Same as {@link consumeAsync}, but for multiple items at once. @param purchases The list of PurchaseInfo objects representing the purchases to consume. @param listener The listener to notify when the consumption oper...
java
public void consumeAsync(List<Purchase> purchases, OnConsumeMultiFinishedListener listener) { checkNotDisposed(); checkSetupDone("consume"); consumeAsyncInternal(purchases, null, listener); }
[ "public", "void", "consumeAsync", "(", "List", "<", "Purchase", ">", "purchases", ",", "OnConsumeMultiFinishedListener", "listener", ")", "{", "checkNotDisposed", "(", ")", ";", "checkSetupDone", "(", "\"consume\"", ")", ";", "consumeAsyncInternal", "(", "purchases"...
Same as {@link consumeAsync}, but for multiple items at once. @param purchases The list of PurchaseInfo objects representing the purchases to consume. @param listener The listener to notify when the consumption operation finishes.
[ "Same", "as", "{" ]
train
https://github.com/williamwebb/alogger/blob/61fca49e0b8d9c3a76c40da8883ac354b240351e/BillingHelper/src/main/java/com/jug6ernaut/billing/IabHelper.java#L747-L751
JOML-CI/JOML
src/org/joml/Vector4f.java
Vector4f.set
public Vector4f set(int index, FloatBuffer buffer) { """ Read this vector from the supplied {@link FloatBuffer} starting at the specified absolute buffer position/index. <p> This method will not increment the position of the given FloatBuffer. @param index the absolute position into the FloatBuffer @param ...
java
public Vector4f set(int index, FloatBuffer buffer) { MemUtil.INSTANCE.get(this, index, buffer); return this; }
[ "public", "Vector4f", "set", "(", "int", "index", ",", "FloatBuffer", "buffer", ")", "{", "MemUtil", ".", "INSTANCE", ".", "get", "(", "this", ",", "index", ",", "buffer", ")", ";", "return", "this", ";", "}" ]
Read this vector from the supplied {@link FloatBuffer} starting at the specified absolute buffer position/index. <p> This method will not increment the position of the given FloatBuffer. @param index the absolute position into the FloatBuffer @param buffer values will be read in <code>x, y, z, w</code> order @return t...
[ "Read", "this", "vector", "from", "the", "supplied", "{", "@link", "FloatBuffer", "}", "starting", "at", "the", "specified", "absolute", "buffer", "position", "/", "index", ".", "<p", ">", "This", "method", "will", "not", "increment", "the", "position", "of"...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4f.java#L495-L498
Azure/azure-sdk-for-java
redis/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/redis/v2018_03_01/implementation/PatchSchedulesInner.java
PatchSchedulesInner.createOrUpdate
public RedisPatchScheduleInner createOrUpdate(String resourceGroupName, String name, List<ScheduleEntry> scheduleEntries) { """ Create or replace the patching schedule for Redis cache (requires Premium SKU). @param resourceGroupName The name of the resource group. @param name The name of the Redis cache. @par...
java
public RedisPatchScheduleInner createOrUpdate(String resourceGroupName, String name, List<ScheduleEntry> scheduleEntries) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, scheduleEntries).toBlocking().single().body(); }
[ "public", "RedisPatchScheduleInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "name", ",", "List", "<", "ScheduleEntry", ">", "scheduleEntries", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "name"...
Create or replace the patching schedule for Redis cache (requires Premium SKU). @param resourceGroupName The name of the resource group. @param name The name of the Redis cache. @param scheduleEntries List of patch schedules for a Redis cache. @throws IllegalArgumentException thrown if parameters fail the validation @...
[ "Create", "or", "replace", "the", "patching", "schedule", "for", "Redis", "cache", "(", "requires", "Premium", "SKU", ")", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/redis/v2018_03_01/implementation/PatchSchedulesInner.java#L222-L224
joniles/mpxj
src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java
MSPDIReader.readResourceBaselines
private void readResourceBaselines(Project.Resources.Resource xmlResource, Resource mpxjResource) { """ Reads baseline values for the current resource. @param xmlResource MSPDI resource instance @param mpxjResource MPXJ resource instance """ for (Project.Resources.Resource.Baseline baseline : xmlReso...
java
private void readResourceBaselines(Project.Resources.Resource xmlResource, Resource mpxjResource) { for (Project.Resources.Resource.Baseline baseline : xmlResource.getBaseline()) { int number = NumberHelper.getInt(baseline.getNumber()); Double cost = DatatypeConverter.parseCurrency(bas...
[ "private", "void", "readResourceBaselines", "(", "Project", ".", "Resources", ".", "Resource", "xmlResource", ",", "Resource", "mpxjResource", ")", "{", "for", "(", "Project", ".", "Resources", ".", "Resource", ".", "Baseline", "baseline", ":", "xmlResource", "....
Reads baseline values for the current resource. @param xmlResource MSPDI resource instance @param mpxjResource MPXJ resource instance
[ "Reads", "baseline", "values", "for", "the", "current", "resource", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java#L978-L998
apache/groovy
src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
ResourceGroovyMethods.newInputStream
public static BufferedInputStream newInputStream(URL url, Map parameters) throws MalformedURLException, IOException { """ Creates a buffered input stream for this URL. The default connection parameters can be modified by adding keys to the <i>parameters map</i>: <ul> <li>connectTimeout : the connection timeout...
java
public static BufferedInputStream newInputStream(URL url, Map parameters) throws MalformedURLException, IOException { return new BufferedInputStream(configuredInputStream(parameters, url)); }
[ "public", "static", "BufferedInputStream", "newInputStream", "(", "URL", "url", ",", "Map", "parameters", ")", "throws", "MalformedURLException", ",", "IOException", "{", "return", "new", "BufferedInputStream", "(", "configuredInputStream", "(", "parameters", ",", "ur...
Creates a buffered input stream for this URL. The default connection parameters can be modified by adding keys to the <i>parameters map</i>: <ul> <li>connectTimeout : the connection timeout</li> <li>readTimeout : the read timeout</li> <li>useCaches : set the use cache property for the URL connection</li> <li>allowUserI...
[ "Creates", "a", "buffered", "input", "stream", "for", "this", "URL", ".", "The", "default", "connection", "parameters", "can", "be", "modified", "by", "adding", "keys", "to", "the", "<i", ">", "parameters", "map<", "/", "i", ">", ":", "<ul", ">", "<li", ...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2218-L2220
nohana/Amalgam
amalgam/src/main/java/com/amalgam/view/MotionEventUtils.java
MotionEventUtils.getHorizontalMotionDirection
public static MotionDirection getHorizontalMotionDirection(float delta, float threshold) { """ Calculate the horizontal move motion direction. @param delta moved delta. @param threshold threshold to detect the motion. @return the motion direction for the horizontal axis. """ if (threshold < 0) { ...
java
public static MotionDirection getHorizontalMotionDirection(float delta, float threshold) { if (threshold < 0) { throw new IllegalArgumentException("threshold should be positive or zero."); } return delta < -threshold ? MotionDirection.LEFT : delta > threshold ? MotionDirection.RIGHT ...
[ "public", "static", "MotionDirection", "getHorizontalMotionDirection", "(", "float", "delta", ",", "float", "threshold", ")", "{", "if", "(", "threshold", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"threshold should be positive or zero.\"", ...
Calculate the horizontal move motion direction. @param delta moved delta. @param threshold threshold to detect the motion. @return the motion direction for the horizontal axis.
[ "Calculate", "the", "horizontal", "move", "motion", "direction", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/view/MotionEventUtils.java#L72-L77
diffplug/durian
src/com/diffplug/common/base/Suppliers.java
Suppliers.memoizeWithExpiration
public static <T> Supplier<T> memoizeWithExpiration(Supplier<T> delegate, long duration, TimeUnit unit) { """ Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed. Subsequent calls to {@code get()} return the cached value if the exp...
java
public static <T> Supplier<T> memoizeWithExpiration(Supplier<T> delegate, long duration, TimeUnit unit) { return new ExpiringMemoizingSupplier<>(delegate, duration, unit); }
[ "public", "static", "<", "T", ">", "Supplier", "<", "T", ">", "memoizeWithExpiration", "(", "Supplier", "<", "T", ">", "delegate", ",", "long", "duration", ",", "TimeUnit", "unit", ")", "{", "return", "new", "ExpiringMemoizingSupplier", "<>", "(", "delegate"...
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed. Subsequent calls to {@code get()} return the cached value if the expiration time has not passed. After the expiration time, a new value is retrieved, cached, and returned. See: <a href=...
[ "Returns", "a", "supplier", "that", "caches", "the", "instance", "supplied", "by", "the", "delegate", "and", "removes", "the", "cached", "value", "after", "the", "specified", "time", "has", "passed", ".", "Subsequent", "calls", "to", "{", "@code", "get", "()...
train
https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/Suppliers.java#L119-L121
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newIdentityException
public static IdentityException newIdentityException(Throwable cause, String message, Object... args) { """ Constructs and initializes a new {@link IdentityException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause {@link Throw...
java
public static IdentityException newIdentityException(Throwable cause, String message, Object... args) { return new IdentityException(format(message, args), cause); }
[ "public", "static", "IdentityException", "newIdentityException", "(", "Throwable", "cause", ",", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "new", "IdentityException", "(", "format", "(", "message", ",", "args", ")", ",", "cause", "...
Constructs and initializes a new {@link IdentityException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause {@link Throwable} identified as the reason this {@link IdentityException} was thrown. @param message {@link String} describing t...
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "IdentityException", "}", "with", "the", "given", "{", "@link", "Throwable", "cause", "}", "and", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", "Object...
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L369-L371
codelibs/elasticsearch-sstmpl
src/main/java/org/codelibs/elasticsearch/sstmpl/rest/RestMultiSearchScriptTemplateAction.java
RestMultiSearchScriptTemplateAction.parseRequest
public static MultiSearchScriptTemplateRequest parseRequest(final RestRequest restRequest, final boolean allowExplicitIndex) throws IOException { """ Parses a {@link RestRequest} body and returns a {@link MultiSearchScriptTemplateRequest} """ final MultiSearchScriptTemplateRequest multiRequ...
java
public static MultiSearchScriptTemplateRequest parseRequest(final RestRequest restRequest, final boolean allowExplicitIndex) throws IOException { final MultiSearchScriptTemplateRequest multiRequest = new MultiSearchScriptTemplateRequest(); if (restRequest.hasParam("max_concurrent_searches"))...
[ "public", "static", "MultiSearchScriptTemplateRequest", "parseRequest", "(", "final", "RestRequest", "restRequest", ",", "final", "boolean", "allowExplicitIndex", ")", "throws", "IOException", "{", "final", "MultiSearchScriptTemplateRequest", "multiRequest", "=", "new", "Mu...
Parses a {@link RestRequest} body and returns a {@link MultiSearchScriptTemplateRequest}
[ "Parses", "a", "{" ]
train
https://github.com/codelibs/elasticsearch-sstmpl/blob/4273de701b805d3efc6fa4dc3338f94deabb9d6f/src/main/java/org/codelibs/elasticsearch/sstmpl/rest/RestMultiSearchScriptTemplateAction.java#L83-L105
alkacon/opencms-core
src/org/opencms/ade/galleries/CmsPreviewService.java
CmsPreviewService.readFocalPoint
public static CmsPoint readFocalPoint(CmsObject cms, CmsResource resource) throws CmsException { """ Reads the focal point from a resource.<p> @param cms the CMS context to use @param resource the resource @return the focal point (or null, if the focal point property is not set or contains an invalid value) ...
java
public static CmsPoint readFocalPoint(CmsObject cms, CmsResource resource) throws CmsException { CmsProperty focalPointProp = cms.readPropertyObject( resource, CmsPropertyDefinition.PROPERTY_IMAGE_FOCAL_POINT, false); CmsPoint focalPoint = null; if (!focalPoi...
[ "public", "static", "CmsPoint", "readFocalPoint", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "CmsProperty", "focalPointProp", "=", "cms", ".", "readPropertyObject", "(", "resource", ",", "CmsPropertyDefinition", ".", ...
Reads the focal point from a resource.<p> @param cms the CMS context to use @param resource the resource @return the focal point (or null, if the focal point property is not set or contains an invalid value) @throws CmsException if something goes wrong
[ "Reads", "the", "focal", "point", "from", "a", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsPreviewService.java#L180-L198
MenoData/Time4J
base/src/main/java/net/time4j/LongElement.java
LongElement.create
static LongElement create( String name, long defaultMin, long defaultMax ) { """ <p>Erzeugt ein neues Uhrzeitelement ohne Formatsymbol. </p> @param name name of element @param defaultMin default minimum @param defaultMax default maximum """ return new Lo...
java
static LongElement create( String name, long defaultMin, long defaultMax ) { return new LongElement(name, defaultMin, defaultMax); }
[ "static", "LongElement", "create", "(", "String", "name", ",", "long", "defaultMin", ",", "long", "defaultMax", ")", "{", "return", "new", "LongElement", "(", "name", ",", "defaultMin", ",", "defaultMax", ")", ";", "}" ]
<p>Erzeugt ein neues Uhrzeitelement ohne Formatsymbol. </p> @param name name of element @param defaultMin default minimum @param defaultMax default maximum
[ "<p", ">", "Erzeugt", "ein", "neues", "Uhrzeitelement", "ohne", "Formatsymbol", ".", "<", "/", "p", ">" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/LongElement.java#L164-L172
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.cpacc
public void cpacc(String sourceName, String destName) throws CmsException { """ Copies access control entries of a given resource to another resource.<p> Already existing access control entries of the destination resource are removed.<p> @param sourceName the name of the resource of which the access control ...
java
public void cpacc(String sourceName, String destName) throws CmsException { CmsResource source = readResource(sourceName); CmsResource dest = readResource(destName); m_securityManager.copyAccessControlEntries(m_context, source, dest); }
[ "public", "void", "cpacc", "(", "String", "sourceName", ",", "String", "destName", ")", "throws", "CmsException", "{", "CmsResource", "source", "=", "readResource", "(", "sourceName", ")", ";", "CmsResource", "dest", "=", "readResource", "(", "destName", ")", ...
Copies access control entries of a given resource to another resource.<p> Already existing access control entries of the destination resource are removed.<p> @param sourceName the name of the resource of which the access control entries are copied @param destName the name of the resource to which the access control e...
[ "Copies", "access", "control", "entries", "of", "a", "given", "resource", "to", "another", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L639-L644
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/io/Serializables.java
Serializables.fromBase64
public static <T extends Serializable>T fromBase64(byte[] bytes) throws IOException, ClassNotFoundException { """ Utility for returning a Serializable object from a byte array. Only use this method if the data was originally serialized using the {@link Serializables#toBase64(Serializable)} method. """ ...
java
public static <T extends Serializable>T fromBase64(byte[] bytes) throws IOException, ClassNotFoundException { return fromBase64(bytes, false); }
[ "public", "static", "<", "T", "extends", "Serializable", ">", "T", "fromBase64", "(", "byte", "[", "]", "bytes", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "return", "fromBase64", "(", "bytes", ",", "false", ")", ";", "}" ]
Utility for returning a Serializable object from a byte array. Only use this method if the data was originally serialized using the {@link Serializables#toBase64(Serializable)} method.
[ "Utility", "for", "returning", "a", "Serializable", "object", "from", "a", "byte", "array", ".", "Only", "use", "this", "method", "if", "the", "data", "was", "originally", "serialized", "using", "the", "{" ]
train
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/io/Serializables.java#L94-L96
cloudinary/cloudinary_java
cloudinary-http43/src/main/java/com/cloudinary/http43/ApiStrategy.java
ApiStrategy.prepareRequest
private HttpUriRequest prepareRequest(HttpMethod method, String apiUrl, Map<String, ?> params, Map options) throws URISyntaxException, UnsupportedEncodingException { """ Prepare a request with the URL and parameters based on the HTTP method used @param method the HTTP method: GET, PUT, POST, DELETE @param apiU...
java
private HttpUriRequest prepareRequest(HttpMethod method, String apiUrl, Map<String, ?> params, Map options) throws URISyntaxException, UnsupportedEncodingException { URI apiUri; HttpRequestBase request; String contentType = ObjectUtils.asString(options.get("content_type"), "urlencoded"); ...
[ "private", "HttpUriRequest", "prepareRequest", "(", "HttpMethod", "method", ",", "String", "apiUrl", ",", "Map", "<", "String", ",", "?", ">", "params", ",", "Map", "options", ")", "throws", "URISyntaxException", ",", "UnsupportedEncodingException", "{", "URI", ...
Prepare a request with the URL and parameters based on the HTTP method used @param method the HTTP method: GET, PUT, POST, DELETE @param apiUrl the cloudinary API URI @param params the parameters to pass to the server @return an HTTP request @throws URISyntaxException @throws UnsupportedEncodingException
[ "Prepare", "a", "request", "with", "the", "URL", "and", "parameters", "based", "on", "the", "HTTP", "method", "used" ]
train
https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-http43/src/main/java/com/cloudinary/http43/ApiStrategy.java#L141-L179
roboconf/roboconf-platform
core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/AgentUtils.java
AgentUtils.collectLogs
public static Map<String,byte[]> collectLogs( String karafData ) throws IOException { """ Collect the main log files into a map. @param karafData the Karaf's data directory @return a non-null map """ Map<String,byte[]> logFiles = new HashMap<>( 2 ); if( ! Utils.isEmptyOrWhitespaces( karafData )) { S...
java
public static Map<String,byte[]> collectLogs( String karafData ) throws IOException { Map<String,byte[]> logFiles = new HashMap<>( 2 ); if( ! Utils.isEmptyOrWhitespaces( karafData )) { String[] names = { "karaf.log", "roboconf.log" }; for( String name : names ) { File log = new File( karafData, AgentCon...
[ "public", "static", "Map", "<", "String", ",", "byte", "[", "]", ">", "collectLogs", "(", "String", "karafData", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "byte", "[", "]", ">", "logFiles", "=", "new", "HashMap", "<>", "(", "2", "...
Collect the main log files into a map. @param karafData the Karaf's data directory @return a non-null map
[ "Collect", "the", "main", "log", "files", "into", "a", "map", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/AgentUtils.java#L189-L206
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/impl/TransactionTable.java
TransactionTable.getOrCreateLocalTransaction
public LocalTransaction getOrCreateLocalTransaction(Transaction transaction, boolean implicitTransaction, Supplier<GlobalTransaction> gtxFactory) { """ Similar to {@link #getOrCreateLocalTransaction(Transaction, boolean)} but with a custom global transaction factory. """ LocalTransaction current = localT...
java
public LocalTransaction getOrCreateLocalTransaction(Transaction transaction, boolean implicitTransaction, Supplier<GlobalTransaction> gtxFactory) { LocalTransaction current = localTransactions.get(transaction); if (current == null) { if (!running) { // Assume that we wouldn't get this f...
[ "public", "LocalTransaction", "getOrCreateLocalTransaction", "(", "Transaction", "transaction", ",", "boolean", "implicitTransaction", ",", "Supplier", "<", "GlobalTransaction", ">", "gtxFactory", ")", "{", "LocalTransaction", "current", "=", "localTransactions", ".", "ge...
Similar to {@link #getOrCreateLocalTransaction(Transaction, boolean)} but with a custom global transaction factory.
[ "Similar", "to", "{" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/impl/TransactionTable.java#L426-L444
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelReader.java
ExcelReader.readCellValue
public Object readCellValue(int x, int y) { """ 读取某个单元格的值 @param x X坐标,从0计数,既列号 @param y Y坐标,从0计数,既行号 @return 值,如果单元格无值返回null @since 4.0.3 """ return CellUtil.getCellValue(getCell(x, y), this.cellEditor); }
java
public Object readCellValue(int x, int y) { return CellUtil.getCellValue(getCell(x, y), this.cellEditor); }
[ "public", "Object", "readCellValue", "(", "int", "x", ",", "int", "y", ")", "{", "return", "CellUtil", ".", "getCellValue", "(", "getCell", "(", "x", ",", "y", ")", ",", "this", ".", "cellEditor", ")", ";", "}" ]
读取某个单元格的值 @param x X坐标,从0计数,既列号 @param y Y坐标,从0计数,既行号 @return 值,如果单元格无值返回null @since 4.0.3
[ "读取某个单元格的值" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelReader.java#L413-L415
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java
EnhanceImageOps.sharpen8
public static void sharpen8(GrayU8 input , GrayU8 output ) { """ Applies a Laplacian-8 based sharpen filter to the image. @param input Input image. @param output Output image. """ InputSanityCheck.checkSameShape(input, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplEnhanceFilter_MT.sharpenInne...
java
public static void sharpen8(GrayU8 input , GrayU8 output ) { InputSanityCheck.checkSameShape(input, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplEnhanceFilter_MT.sharpenInner8(input,output,0,255); ImplEnhanceFilter_MT.sharpenBorder8(input,output,0,255); } else { ImplEnhanceFilter.sharpenInner8(in...
[ "public", "static", "void", "sharpen8", "(", "GrayU8", "input", ",", "GrayU8", "output", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "input", ",", "output", ")", ";", "if", "(", "BoofConcurrency", ".", "USE_CONCURRENT", ")", "{", "ImplEnhanceFilt...
Applies a Laplacian-8 based sharpen filter to the image. @param input Input image. @param output Output image.
[ "Applies", "a", "Laplacian", "-", "8", "based", "sharpen", "filter", "to", "the", "image", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java#L343-L353
UrielCh/ovh-java-sdk
ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java
ApiOvhEmaildomain.mailingListLimits_GET
public OvhDomainMlLimits mailingListLimits_GET(Boolean moderatorMessage) throws IOException { """ Get limits of mailing list REST: GET /email/domain/mailingListLimits @param moderatorMessage [required] If true, messages are moderate """ String qPath = "/email/domain/mailingListLimits"; StringBuilder sb...
java
public OvhDomainMlLimits mailingListLimits_GET(Boolean moderatorMessage) throws IOException { String qPath = "/email/domain/mailingListLimits"; StringBuilder sb = path(qPath); query(sb, "moderatorMessage", moderatorMessage); String resp = execN(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhDom...
[ "public", "OvhDomainMlLimits", "mailingListLimits_GET", "(", "Boolean", "moderatorMessage", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/email/domain/mailingListLimits\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ")", ";", "query", "(",...
Get limits of mailing list REST: GET /email/domain/mailingListLimits @param moderatorMessage [required] If true, messages are moderate
[ "Get", "limits", "of", "mailing", "list" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L73-L79
casbin/jcasbin
src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java
ManagementEnforcer.getFilteredPolicy
public List<List<String>> getFilteredPolicy(int fieldIndex, String... fieldValues) { """ getFilteredPolicy gets all the authorization rules in the policy, field filters can be specified. @param fieldIndex the policy rule's start index to be matched. @param fieldValues the field values to be matched, value "" ...
java
public List<List<String>> getFilteredPolicy(int fieldIndex, String... fieldValues) { return getFilteredNamedPolicy("p", fieldIndex, fieldValues); }
[ "public", "List", "<", "List", "<", "String", ">", ">", "getFilteredPolicy", "(", "int", "fieldIndex", ",", "String", "...", "fieldValues", ")", "{", "return", "getFilteredNamedPolicy", "(", "\"p\"", ",", "fieldIndex", ",", "fieldValues", ")", ";", "}" ]
getFilteredPolicy gets all the authorization rules in the policy, field filters can be specified. @param fieldIndex the policy rule's start index to be matched. @param fieldValues the field values to be matched, value "" means not to match this field. @return the filtered "p" policy rules.
[ "getFilteredPolicy", "gets", "all", "the", "authorization", "rules", "in", "the", "policy", "field", "filters", "can", "be", "specified", "." ]
train
https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java#L143-L145
jenkinsci/favorite-plugin
src/main/java/hudson/plugins/favorite/Favorites.java
Favorites.hasFavorite
public static boolean hasFavorite(@Nonnull User user, @Nonnull Item item) throws FavoriteException { """ Check if the item has a favorite entry regardless of its state This is useful for checking if a favorite/unfavorite operation has ever been performed against this user @param user to check @param item to che...
java
public static boolean hasFavorite(@Nonnull User user, @Nonnull Item item) throws FavoriteException { try { FavoriteUserProperty property = getProperty(user); return property.hasFavorite(item.getFullName()); } catch (IOException e) { throw new FavoriteException("Could ...
[ "public", "static", "boolean", "hasFavorite", "(", "@", "Nonnull", "User", "user", ",", "@", "Nonnull", "Item", "item", ")", "throws", "FavoriteException", "{", "try", "{", "FavoriteUserProperty", "property", "=", "getProperty", "(", "user", ")", ";", "return"...
Check if the item has a favorite entry regardless of its state This is useful for checking if a favorite/unfavorite operation has ever been performed against this user @param user to check @param item to check @return favorite state @throws FavoriteException
[ "Check", "if", "the", "item", "has", "a", "favorite", "entry", "regardless", "of", "its", "state", "This", "is", "useful", "for", "checking", "if", "a", "favorite", "/", "unfavorite", "operation", "has", "ever", "been", "performed", "against", "this", "user"...
train
https://github.com/jenkinsci/favorite-plugin/blob/4ce9b195b4d888190fe12c92d546d64f22728c22/src/main/java/hudson/plugins/favorite/Favorites.java#L56-L63
kirgor/enklib
sql/src/main/java/com/kirgor/enklib/sql/dialect/PostgreSQLDialect.java
PostgreSQLDialect.buildStoredProcedureQuery
@Override public String buildStoredProcedureQuery(String name, int paramsCount) { """ {@inheritDoc} <p/> Returns something like "SELECT * FROM get_orders(?,?,?)". """ StringBuilder sb = new StringBuilder("SELECT * FROM "); sb.append(name); sb.append("("); for (int i = 0; i...
java
@Override public String buildStoredProcedureQuery(String name, int paramsCount) { StringBuilder sb = new StringBuilder("SELECT * FROM "); sb.append(name); sb.append("("); for (int i = 0; i < paramsCount; i++) { sb.append("?,"); } if (paramsCount > 0) { ...
[ "@", "Override", "public", "String", "buildStoredProcedureQuery", "(", "String", "name", ",", "int", "paramsCount", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "\"SELECT * FROM \"", ")", ";", "sb", ".", "append", "(", "name", ")", ";", ...
{@inheritDoc} <p/> Returns something like "SELECT * FROM get_orders(?,?,?)".
[ "{" ]
train
https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/sql/src/main/java/com/kirgor/enklib/sql/dialect/PostgreSQLDialect.java#L14-L28
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java
AddressInfo.of
public static AddressInfo of(RegionId regionId, String name) { """ Returns an {@code AddressInfo} object for the provided region identity and name. The object corresponds to a region address. """ return of(RegionAddressId.of(regionId, name)); }
java
public static AddressInfo of(RegionId regionId, String name) { return of(RegionAddressId.of(regionId, name)); }
[ "public", "static", "AddressInfo", "of", "(", "RegionId", "regionId", ",", "String", "name", ")", "{", "return", "of", "(", "RegionAddressId", ".", "of", "(", "regionId", ",", "name", ")", ")", ";", "}" ]
Returns an {@code AddressInfo} object for the provided region identity and name. The object corresponds to a region address.
[ "Returns", "an", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java#L533-L535
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java
JSONDeserializer.deserializeObject
private static <T> T deserializeObject(final Class<T> expectedType, final String json, final ClassFieldCache classFieldCache) throws IllegalArgumentException { """ Deserialize JSON to a new object graph, with the root object of the specified expected type, using or reusing the given type cache. Does n...
java
private static <T> T deserializeObject(final Class<T> expectedType, final String json, final ClassFieldCache classFieldCache) throws IllegalArgumentException { // Parse the JSON Object parsedJSON; try { parsedJSON = JSONParser.parseJSON(json); } catch (final Parse...
[ "private", "static", "<", "T", ">", "T", "deserializeObject", "(", "final", "Class", "<", "T", ">", "expectedType", ",", "final", "String", "json", ",", "final", "ClassFieldCache", "classFieldCache", ")", "throws", "IllegalArgumentException", "{", "// Parse the JS...
Deserialize JSON to a new object graph, with the root object of the specified expected type, using or reusing the given type cache. Does not work for generic types, since it is not possible to obtain the generic type of a Class reference. @param <T> the expected type @param expectedType The type that the JSON should c...
[ "Deserialize", "JSON", "to", "a", "new", "object", "graph", "with", "the", "root", "object", "of", "the", "specified", "expected", "type", "using", "or", "reusing", "the", "given", "type", "cache", ".", "Does", "not", "work", "for", "generic", "types", "si...
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java#L642-L672
heroku/heroku.jar
heroku-api/src/main/java/com/heroku/api/HerokuAPI.java
HerokuAPI.setMaintenanceMode
public void setMaintenanceMode(String appName, boolean enable) { """ Sets maintenance mode for the given app @param appName See {@link #listApps} for a list of apps that can be used. @param enable true to enable; false to disable """ connection.execute(new AppUpdate(appName, enable), apiKey); }
java
public void setMaintenanceMode(String appName, boolean enable) { connection.execute(new AppUpdate(appName, enable), apiKey); }
[ "public", "void", "setMaintenanceMode", "(", "String", "appName", ",", "boolean", "enable", ")", "{", "connection", ".", "execute", "(", "new", "AppUpdate", "(", "appName", ",", "enable", ")", ",", "apiKey", ")", ";", "}" ]
Sets maintenance mode for the given app @param appName See {@link #listApps} for a list of apps that can be used. @param enable true to enable; false to disable
[ "Sets", "maintenance", "mode", "for", "the", "given", "app" ]
train
https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/HerokuAPI.java#L403-L405
biojava/biojava
biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java
WorkSheet.randomlyDivideSave
public void randomlyDivideSave(double percentage, String fileName1, String fileName2) throws Exception { """ Split a worksheet randomly. Used for creating a discovery/validation data set The first file name will matched the percentage and the second file the remainder @param percentage @param fileName1 @par...
java
public void randomlyDivideSave(double percentage, String fileName1, String fileName2) throws Exception { ArrayList<String> rows = this.getDataRows(); Collections.shuffle(rows); int portion = (int) (rows.size() * percentage); for (int i = 0; i < portion; i++) { this.hideRow(rows.get(i), true); } this.save...
[ "public", "void", "randomlyDivideSave", "(", "double", "percentage", ",", "String", "fileName1", ",", "String", "fileName2", ")", "throws", "Exception", "{", "ArrayList", "<", "String", ">", "rows", "=", "this", ".", "getDataRows", "(", ")", ";", "Collections"...
Split a worksheet randomly. Used for creating a discovery/validation data set The first file name will matched the percentage and the second file the remainder @param percentage @param fileName1 @param fileName2 @throws Exception
[ "Split", "a", "worksheet", "randomly", ".", "Used", "for", "creating", "a", "discovery", "/", "validation", "data", "set", "The", "first", "file", "name", "will", "matched", "the", "percentage", "and", "the", "second", "file", "the", "remainder" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java#L141-L160
sundrio/sundrio
annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java
ToPojo.readAnnotationValue
private static String readAnnotationValue(String ref, TypeDef source, Property property) { """ Returns the string representation of the code that reads a primitive array property. @param ref The reference. @param source The type of the reference. @param property The property to read. @ret...
java
private static String readAnnotationValue(String ref, TypeDef source, Property property) { return convertMap(ref, source, ((ClassRef)property.getTypeRef()).getDefinition()); }
[ "private", "static", "String", "readAnnotationValue", "(", "String", "ref", ",", "TypeDef", "source", ",", "Property", "property", ")", "{", "return", "convertMap", "(", "ref", ",", "source", ",", "(", "(", "ClassRef", ")", "property", ".", "getTypeRef", "("...
Returns the string representation of the code that reads a primitive array property. @param ref The reference. @param source The type of the reference. @param property The property to read. @return The code.
[ "Returns", "the", "string", "representation", "of", "the", "code", "that", "reads", "a", "primitive", "array", "property", "." ]
train
https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java#L837-L839
perwendel/spark
src/main/java/spark/TemplateViewRouteImpl.java
TemplateViewRouteImpl.create
public static TemplateViewRouteImpl create(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) { """ factory method @param path the path ...
java
public static TemplateViewRouteImpl create(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) { return new TemplateViewRouteImpl(path, accept...
[ "public", "static", "TemplateViewRouteImpl", "create", "(", "String", "path", ",", "String", "acceptType", ",", "TemplateViewRoute", "route", ",", "TemplateEngine", "engine", ")", "{", "return", "new", "TemplateViewRouteImpl", "(", "path", ",", "acceptType", ",", ...
factory method @param path the path @param acceptType the accept type @param route the route @param engine the engine @return the wrapper template view route
[ "factory", "method" ]
train
https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/TemplateViewRouteImpl.java#L53-L69
ehcache/ehcache3
core/src/main/java/org/ehcache/core/exceptions/ExceptionFactory.java
ExceptionFactory.newCacheWritingException
public static CacheWritingException newCacheWritingException(Exception e, Exception suppressed) { """ Creates a new {@code CacheWritingException} with the provided exception as cause and a suppressed one. @param e the cause @param suppressed the suppressed exception to add to the new exception @return a cache...
java
public static CacheWritingException newCacheWritingException(Exception e, Exception suppressed) { CacheWritingException ne = new CacheWritingException(e); ne.addSuppressed(suppressed); return ne; }
[ "public", "static", "CacheWritingException", "newCacheWritingException", "(", "Exception", "e", ",", "Exception", "suppressed", ")", "{", "CacheWritingException", "ne", "=", "new", "CacheWritingException", "(", "e", ")", ";", "ne", ".", "addSuppressed", "(", "suppre...
Creates a new {@code CacheWritingException} with the provided exception as cause and a suppressed one. @param e the cause @param suppressed the suppressed exception to add to the new exception @return a cache writing exception
[ "Creates", "a", "new", "{", "@code", "CacheWritingException", "}", "with", "the", "provided", "exception", "as", "cause", "and", "a", "suppressed", "one", "." ]
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/exceptions/ExceptionFactory.java#L58-L62
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java
JDBCResultSet.updateDate
public void updateDate(String columnLabel, Date x) throws SQLException { """ <!-- start generic documentation --> Updates the designated column with a <code>java.sql.Date</code> value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update ...
java
public void updateDate(String columnLabel, Date x) throws SQLException { updateDate(findColumn(columnLabel), x); }
[ "public", "void", "updateDate", "(", "String", "columnLabel", ",", "Date", "x", ")", "throws", "SQLException", "{", "updateDate", "(", "findColumn", "(", "columnLabel", ")", ",", "x", ")", ";", "}" ]
<!-- start generic documentation --> Updates the designated column with a <code>java.sql.Date</code> value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> ...
[ "<!", "--", "start", "generic", "documentation", "--", ">", "Updates", "the", "designated", "column", "with", "a", "<code", ">", "java", ".", "sql", ".", "Date<", "/", "code", ">", "value", ".", "The", "updater", "methods", "are", "used", "to", "update",...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L3610-L3612
landawn/AbacusUtil
src/com/landawn/abacus/util/IntList.java
IntList.anyMatch
public <E extends Exception> boolean anyMatch(Try.IntPredicate<E> filter) throws E { """ Returns whether any elements of this List match the provided predicate. @param filter @return """ return anyMatch(0, size(), filter); }
java
public <E extends Exception> boolean anyMatch(Try.IntPredicate<E> filter) throws E { return anyMatch(0, size(), filter); }
[ "public", "<", "E", "extends", "Exception", ">", "boolean", "anyMatch", "(", "Try", ".", "IntPredicate", "<", "E", ">", "filter", ")", "throws", "E", "{", "return", "anyMatch", "(", "0", ",", "size", "(", ")", ",", "filter", ")", ";", "}" ]
Returns whether any elements of this List match the provided predicate. @param filter @return
[ "Returns", "whether", "any", "elements", "of", "this", "List", "match", "the", "provided", "predicate", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/IntList.java#L1011-L1013
weld/core
environments/servlet/core/src/main/java/org/jboss/weld/environment/tomcat/SecurityActions.java
SecurityActions.lookupMethod
static Method lookupMethod(Class<?> javaClass, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException { """ Does not perform {@link PrivilegedAction} unless necessary. @param javaClass @param methodName @param parameterTypes @return a method from the class or any class/interface in the i...
java
static Method lookupMethod(Class<?> javaClass, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException { if (System.getSecurityManager() != null) { try { return AccessController.doPrivileged(new MethodLookupAction(javaClass, methodName, parameterTypes)); ...
[ "static", "Method", "lookupMethod", "(", "Class", "<", "?", ">", "javaClass", ",", "String", "methodName", ",", "Class", "<", "?", ">", "...", "parameterTypes", ")", "throws", "NoSuchMethodException", "{", "if", "(", "System", ".", "getSecurityManager", "(", ...
Does not perform {@link PrivilegedAction} unless necessary. @param javaClass @param methodName @param parameterTypes @return a method from the class or any class/interface in the inheritance hierarchy @throws NoSuchMethodException
[ "Does", "not", "perform", "{", "@link", "PrivilegedAction", "}", "unless", "necessary", "." ]
train
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/tomcat/SecurityActions.java#L49-L62
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java
ListViewUrl.getEntityListViewsUrl
public static MozuUrl getEntityListViewsUrl(String entityListFullName, String responseFields) { """ Get Resource Url for GetEntityListViews @param entityListFullName The full name of the EntityList including namespace in name@nameSpace format @param responseFields Filtering syntax appended to an API call to incr...
java
public static MozuUrl getEntityListViewsUrl(String entityListFullName, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/views?responseFields={responseFields}"); formatter.formatUrl("entityListFullName", entityListFullName); formatter.formatUrl...
[ "public", "static", "MozuUrl", "getEntityListViewsUrl", "(", "String", "entityListFullName", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/platform/entitylists/{entityListFullName}/views?responseFields={responseFi...
Get Resource Url for GetEntityListViews @param entityListFullName The full name of the EntityList including namespace in name@nameSpace format @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to re...
[ "Get", "Resource", "Url", "for", "GetEntityListViews" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java#L118-L124
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelUtils.java
KerasModelUtils.copyWeightsToModel
public static Model copyWeightsToModel(Model model, Map<String, KerasLayer> kerasLayers) throws InvalidKerasConfigurationException { """ Helper function to import weights from nested Map into existing model. Depends critically on matched layer and parameter names. In general this seems to be straightf...
java
public static Model copyWeightsToModel(Model model, Map<String, KerasLayer> kerasLayers) throws InvalidKerasConfigurationException { /* Get list if layers from model. */ Layer[] layersFromModel; if (model instanceof MultiLayerNetwork) layersFromModel = ((MultiLayerNetwork...
[ "public", "static", "Model", "copyWeightsToModel", "(", "Model", "model", ",", "Map", "<", "String", ",", "KerasLayer", ">", "kerasLayers", ")", "throws", "InvalidKerasConfigurationException", "{", "/* Get list if layers from model. */", "Layer", "[", "]", "layersFromMo...
Helper function to import weights from nested Map into existing model. Depends critically on matched layer and parameter names. In general this seems to be straightforward for most Keras models and layersOrdered, but there may be edge cases. @param model DL4J Model interface @return DL4J Model interface @throws Invali...
[ "Helper", "function", "to", "import", "weights", "from", "nested", "Map", "into", "existing", "model", ".", "Depends", "critically", "on", "matched", "layer", "and", "parameter", "names", ".", "In", "general", "this", "seems", "to", "be", "straightforward", "f...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelUtils.java#L60-L86
kaazing/gateway
service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryServiceHandler.java
HttpDirectoryServiceHandler.addCacheControl
private void addCacheControl(HttpAcceptSession session, File requestFile, String requestPath) { """ Matches the file URL with the most specific pattern and caches this information in a map Sets cache-control and expires headers @param session @param requestFile @param requestPath """ CacheControlHa...
java
private void addCacheControl(HttpAcceptSession session, File requestFile, String requestPath) { CacheControlHandler cacheControlHandler = urlCacheControlMap.computeIfAbsent(requestPath, path -> patterns.stream() .filter(patternCacheControl -> PatternMatcherUtils.caseInsensi...
[ "private", "void", "addCacheControl", "(", "HttpAcceptSession", "session", ",", "File", "requestFile", ",", "String", "requestPath", ")", "{", "CacheControlHandler", "cacheControlHandler", "=", "urlCacheControlMap", ".", "computeIfAbsent", "(", "requestPath", ",", "path...
Matches the file URL with the most specific pattern and caches this information in a map Sets cache-control and expires headers @param session @param requestFile @param requestPath
[ "Matches", "the", "file", "URL", "with", "the", "most", "specific", "pattern", "and", "caches", "this", "information", "in", "a", "map", "Sets", "cache", "-", "control", "and", "expires", "headers" ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryServiceHandler.java#L311-L323
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.findIndexOf
public static <T> int findIndexOf(Iterator<T> self, int startIndex, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) { """ Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the clo...
java
public static <T> int findIndexOf(Iterator<T> self, int startIndex, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) { int result = -1; int i = 0; BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition); while (self.hasNext()) { Object value = sel...
[ "public", "static", "<", "T", ">", "int", "findIndexOf", "(", "Iterator", "<", "T", ">", "self", ",", "int", "startIndex", ",", "@", "ClosureParams", "(", "FirstParam", ".", "FirstGenericType", ".", "class", ")", "Closure", "condition", ")", "{", "int", ...
Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the closure. @param self an Iterator @param startIndex start matching from this index @param condition the matching condition @return an integer that...
[ "Iterates", "over", "the", "elements", "of", "an", "Iterator", "starting", "from", "a", "specified", "startIndex", "and", "returns", "the", "index", "of", "the", "first", "item", "that", "satisfies", "the", "condition", "specified", "by", "the", "closure", "."...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16737-L16752
square/okhttp
okhttp/src/main/java/okhttp3/internal/http2/Http2Stream.java
Http2Stream.close
public void close(ErrorCode rstStatusCode, @Nullable IOException errorException) throws IOException { """ Abnormally terminate this stream. This blocks until the {@code RST_STREAM} frame has been transmitted. """ if (!closeInternal(rstStatusCode, errorException)) { return; // Already closed. ...
java
public void close(ErrorCode rstStatusCode, @Nullable IOException errorException) throws IOException { if (!closeInternal(rstStatusCode, errorException)) { return; // Already closed. } connection.writeSynReset(id, rstStatusCode); }
[ "public", "void", "close", "(", "ErrorCode", "rstStatusCode", ",", "@", "Nullable", "IOException", "errorException", ")", "throws", "IOException", "{", "if", "(", "!", "closeInternal", "(", "rstStatusCode", ",", "errorException", ")", ")", "{", "return", ";", ...
Abnormally terminate this stream. This blocks until the {@code RST_STREAM} frame has been transmitted.
[ "Abnormally", "terminate", "this", "stream", ".", "This", "blocks", "until", "the", "{" ]
train
https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/http2/Http2Stream.java#L260-L266
google/closure-compiler
src/com/google/javascript/jscomp/CompilerInput.java
CompilerInput.generateDependencyInfo
private DependencyInfo generateDependencyInfo() { """ Generates the DependencyInfo by scanning and/or parsing the file. This is called lazily by getDependencyInfo, and does not take into account any extra requires/provides added by {@link #addRequire} or {@link #addProvide}. """ Preconditions.checkNotNu...
java
private DependencyInfo generateDependencyInfo() { Preconditions.checkNotNull(compiler, "Expected setCompiler to be called first: %s", this); Preconditions.checkNotNull( compiler.getErrorManager(), "Expected compiler to call an error manager: %s", this); // If the code is a JsAst, then it was origin...
[ "private", "DependencyInfo", "generateDependencyInfo", "(", ")", "{", "Preconditions", ".", "checkNotNull", "(", "compiler", ",", "\"Expected setCompiler to be called first: %s\"", ",", "this", ")", ";", "Preconditions", ".", "checkNotNull", "(", "compiler", ".", "getEr...
Generates the DependencyInfo by scanning and/or parsing the file. This is called lazily by getDependencyInfo, and does not take into account any extra requires/provides added by {@link #addRequire} or {@link #addProvide}.
[ "Generates", "the", "DependencyInfo", "by", "scanning", "and", "/", "or", "parsing", "the", "file", ".", "This", "is", "called", "lazily", "by", "getDependencyInfo", "and", "does", "not", "take", "into", "account", "any", "extra", "requires", "/", "provides", ...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerInput.java#L298-L354
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/impl/ResponseImpl.java
ResponseImpl.doReadEntity
public <T> T doReadEntity(Class<T> cls, Type t, Annotation[] anns) throws ProcessingException, IllegalStateException { """ convenience method for classes that have not been overwritten with liberty-specific changes """ return doReadEntity(cls, t, anns, false); }
java
public <T> T doReadEntity(Class<T> cls, Type t, Annotation[] anns) throws ProcessingException, IllegalStateException { return doReadEntity(cls, t, anns, false); }
[ "public", "<", "T", ">", "T", "doReadEntity", "(", "Class", "<", "T", ">", "cls", ",", "Type", "t", ",", "Annotation", "[", "]", "anns", ")", "throws", "ProcessingException", ",", "IllegalStateException", "{", "return", "doReadEntity", "(", "cls", ",", "...
convenience method for classes that have not been overwritten with liberty-specific changes
[ "convenience", "method", "for", "classes", "that", "have", "not", "been", "overwritten", "with", "liberty", "-", "specific", "changes" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/impl/ResponseImpl.java#L392-L394
ThreeTen/threetenbp
src/main/java/org/threeten/bp/OffsetTime.java
OffsetTime.ofInstant
public static OffsetTime ofInstant(Instant instant, ZoneId zone) { """ Obtains an instance of {@code OffsetTime} from an {@code Instant} and zone ID. <p> This creates an offset time with the same instant as that specified. Finding the offset from UTC/Greenwich is simple as there is only one valid offset for ea...
java
public static OffsetTime ofInstant(Instant instant, ZoneId zone) { Jdk8Methods.requireNonNull(instant, "instant"); Jdk8Methods.requireNonNull(zone, "zone"); ZoneRules rules = zone.getRules(); ZoneOffset offset = rules.getOffset(instant); long secsOfDay = instant.getEpochSecond() ...
[ "public", "static", "OffsetTime", "ofInstant", "(", "Instant", "instant", ",", "ZoneId", "zone", ")", "{", "Jdk8Methods", ".", "requireNonNull", "(", "instant", ",", "\"instant\"", ")", ";", "Jdk8Methods", ".", "requireNonNull", "(", "zone", ",", "\"zone\"", "...
Obtains an instance of {@code OffsetTime} from an {@code Instant} and zone ID. <p> This creates an offset time with the same instant as that specified. Finding the offset from UTC/Greenwich is simple as there is only one valid offset for each instant. <p> The date component of the instant is dropped during the conversi...
[ "Obtains", "an", "instance", "of", "{", "@code", "OffsetTime", "}", "from", "an", "{", "@code", "Instant", "}", "and", "zone", "ID", ".", "<p", ">", "This", "creates", "an", "offset", "time", "with", "the", "same", "instant", "as", "that", "specified", ...
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/OffsetTime.java#L228-L240
Bedework/bw-util
bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java
XmlUtil.getYesNoAttrVal
public static Boolean getYesNoAttrVal(final NamedNodeMap nnm, final String name) throws SAXException { """ The attribute value of the named attribute in the given map must be absent or "yes" or "no". @param nnm NamedNodeMap @param name String name of desired attribute @return Boolean ...
java
public static Boolean getYesNoAttrVal(final NamedNodeMap nnm, final String name) throws SAXException { String val = getAttrVal(nnm, name); if (val == null) { return null; } if ((!"yes".equals(val)) && (!"no".equals(val))) { throw new SAXException("Invalid attribute value: " + val); ...
[ "public", "static", "Boolean", "getYesNoAttrVal", "(", "final", "NamedNodeMap", "nnm", ",", "final", "String", "name", ")", "throws", "SAXException", "{", "String", "val", "=", "getAttrVal", "(", "nnm", ",", "name", ")", ";", "if", "(", "val", "==", "null"...
The attribute value of the named attribute in the given map must be absent or "yes" or "no". @param nnm NamedNodeMap @param name String name of desired attribute @return Boolean attribute value or null @throws SAXException
[ "The", "attribute", "value", "of", "the", "named", "attribute", "in", "the", "given", "map", "must", "be", "absent", "or", "yes", "or", "no", "." ]
train
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java#L270-L283
alkacon/opencms-core
src/org/opencms/search/CmsSearchParameters.java
CmsSearchParameters.addFieldQuery
public void addFieldQuery(String fieldName, String searchQuery, Occur occur) { """ Adds an individual query for a search field.<p> If this is used, any setting made with {@link #setQuery(String)} and {@link #setFields(List)} will be ignored and only the individual field search settings will be used.<p> @par...
java
public void addFieldQuery(String fieldName, String searchQuery, Occur occur) { CmsSearchFieldQuery newQuery = new CmsSearchFieldQuery(fieldName, searchQuery, occur); addFieldQuery(newQuery); }
[ "public", "void", "addFieldQuery", "(", "String", "fieldName", ",", "String", "searchQuery", ",", "Occur", "occur", ")", "{", "CmsSearchFieldQuery", "newQuery", "=", "new", "CmsSearchFieldQuery", "(", "fieldName", ",", "searchQuery", ",", "occur", ")", ";", "add...
Adds an individual query for a search field.<p> If this is used, any setting made with {@link #setQuery(String)} and {@link #setFields(List)} will be ignored and only the individual field search settings will be used.<p> @param fieldName the field name @param searchQuery the search query @param occur the occur parame...
[ "Adds", "an", "individual", "query", "for", "a", "search", "field", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchParameters.java#L407-L411
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/query/AnyUtils.java
AnyUtils.findAttribute
public static MetaAttribute findAttribute(MetaDataObject meta, Object value) { """ Finds a matching attribute for a given value. @param meta the metadataobject @param value the value @return the attribute which will accept the given value """ if (value == null) { throw new IllegalArgumentException("...
java
public static MetaAttribute findAttribute(MetaDataObject meta, Object value) { if (value == null) { throw new IllegalArgumentException("null as value not supported"); } for (MetaAttribute attr : meta.getAttributes()) { if (attr.getName().equals(TYPE_ATTRIBUTE)) { continue; } if (attr.isDerived())...
[ "public", "static", "MetaAttribute", "findAttribute", "(", "MetaDataObject", "meta", ",", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"null as value not supported\"", ")", ";", "}", ...
Finds a matching attribute for a given value. @param meta the metadataobject @param value the value @return the attribute which will accept the given value
[ "Finds", "a", "matching", "attribute", "for", "a", "given", "value", "." ]
train
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/query/AnyUtils.java#L54-L73
fullcontact/hadoop-sstable
sstable-core/src/main/java/com/fullcontact/sstable/index/SSTableIndexIndex.java
SSTableIndexIndex.writeIndex
public static void writeIndex(final FileSystem fileSystem, final Path sstablePath) throws IOException { """ Create and write an index index based on the input Cassandra Index.db file. Read the Index.db and generate chunks (splits) based on the configured chunk size. @param fileSystem Hadoop file system. @para...
java
public static void writeIndex(final FileSystem fileSystem, final Path sstablePath) throws IOException { final Configuration configuration = fileSystem.getConf(); final long splitSize = configuration.getLong(HadoopSSTableConstants.HADOOP_SSTABLE_SPLIT_MB, HadoopSSTableConstants.DEFAULT_...
[ "public", "static", "void", "writeIndex", "(", "final", "FileSystem", "fileSystem", ",", "final", "Path", "sstablePath", ")", "throws", "IOException", "{", "final", "Configuration", "configuration", "=", "fileSystem", ".", "getConf", "(", ")", ";", "final", "lon...
Create and write an index index based on the input Cassandra Index.db file. Read the Index.db and generate chunks (splits) based on the configured chunk size. @param fileSystem Hadoop file system. @param sstablePath SSTable Index.db. @throws IOException
[ "Create", "and", "write", "an", "index", "index", "based", "on", "the", "input", "Cassandra", "Index", ".", "db", "file", ".", "Read", "the", "Index", ".", "db", "and", "generate", "chunks", "(", "splits", ")", "based", "on", "the", "configured", "chunk"...
train
https://github.com/fullcontact/hadoop-sstable/blob/1189c2cb3a2cbbe03b75fda1cf02698e6283dfb2/sstable-core/src/main/java/com/fullcontact/sstable/index/SSTableIndexIndex.java#L89-L143
siom79/japicmp
japicmp/src/main/java/japicmp/cmp/JarArchiveComparator.java
JarArchiveComparator.compareClassLists
List<JApiClass> compareClassLists(JarArchiveComparatorOptions options, List<CtClass> oldClasses, List<CtClass> newClasses) { """ Compares the two lists with CtClass objects using the provided options instance. @param options the options to use @param oldClasses a list of CtClasses that represent the old ver...
java
List<JApiClass> compareClassLists(JarArchiveComparatorOptions options, List<CtClass> oldClasses, List<CtClass> newClasses) { List<CtClass> oldClassesFiltered = applyFilter(options, oldClasses); List<CtClass> newClassesFiltered = applyFilter(options, newClasses); ClassesComparator classesComparator = new ClassesCo...
[ "List", "<", "JApiClass", ">", "compareClassLists", "(", "JarArchiveComparatorOptions", "options", ",", "List", "<", "CtClass", ">", "oldClasses", ",", "List", "<", "CtClass", ">", "newClasses", ")", "{", "List", "<", "CtClass", ">", "oldClassesFiltered", "=", ...
Compares the two lists with CtClass objects using the provided options instance. @param options the options to use @param oldClasses a list of CtClasses that represent the old version @param newClasses a list of CtClasses that represent the new version @return a list of {@link japicmp.model.JApiClass} that represen...
[ "Compares", "the", "two", "lists", "with", "CtClass", "objects", "using", "the", "provided", "options", "instance", "." ]
train
https://github.com/siom79/japicmp/blob/f008ea588eec721c45f568bf1db5074fbcbcfced/japicmp/src/main/java/japicmp/cmp/JarArchiveComparator.java#L203-L218
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getFormatedLabel
public static Label getFormatedLabel(final String labelContent) { """ Get formatted label.Appends ellipses if content does not fit the label. @param labelContent content @return Label """ final Label labelValue = new Label(labelContent, ContentMode.HTML); labelValue.setSizeFull(); ...
java
public static Label getFormatedLabel(final String labelContent) { final Label labelValue = new Label(labelContent, ContentMode.HTML); labelValue.setSizeFull(); labelValue.addStyleName(SPUIDefinitions.TEXT_STYLE); labelValue.addStyleName("label-style"); return labelValue; }
[ "public", "static", "Label", "getFormatedLabel", "(", "final", "String", "labelContent", ")", "{", "final", "Label", "labelValue", "=", "new", "Label", "(", "labelContent", ",", "ContentMode", ".", "HTML", ")", ";", "labelValue", ".", "setSizeFull", "(", ")", ...
Get formatted label.Appends ellipses if content does not fit the label. @param labelContent content @return Label
[ "Get", "formatted", "label", ".", "Appends", "ellipses", "if", "content", "does", "not", "fit", "the", "label", "." ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L248-L254
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/grid/RecordCacheHandler.java
RecordCacheHandler.doRecordChange
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { """ Called when a change is the record status is about to happen/has happened. @param field If this file change is due to a field, this is the field. @param iChangeType The type of change that occurred. @param bDisplayOption I...
java
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { // Return an error to stop the change if (iChangeType == DBConstants.AFTER_REQUERY_TYPE) { this.clearCache(); } if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE) || (iChan...
[ "public", "int", "doRecordChange", "(", "FieldInfo", "field", ",", "int", "iChangeType", ",", "boolean", "bDisplayOption", ")", "{", "// Return an error to stop the change", "if", "(", "iChangeType", "==", "DBConstants", ".", "AFTER_REQUERY_TYPE", ")", "{", "this", ...
Called when a change is the record status is about to happen/has happened. @param field If this file change is due to a field, this is the field. @param iChangeType The type of change that occurred. @param bDisplayOption If true, display any changes. @return an error code.
[ "Called", "when", "a", "change", "is", "the", "record", "status", "is", "about", "to", "happen", "/", "has", "happened", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/grid/RecordCacheHandler.java#L57-L77
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java
ExcelWriter.addHeaderAlias
public ExcelWriter addHeaderAlias(String name, String alias) { """ 增加标题别名 @param name 原标题 @param alias 别名 @return this @since 4.1.5 """ Map<String, String> headerAlias = this.headerAlias; if (null == headerAlias) { headerAlias = new LinkedHashMap<>(); } this.headerAlias = headerAlias; ...
java
public ExcelWriter addHeaderAlias(String name, String alias) { Map<String, String> headerAlias = this.headerAlias; if (null == headerAlias) { headerAlias = new LinkedHashMap<>(); } this.headerAlias = headerAlias; headerAlias.put(name, alias); return this; }
[ "public", "ExcelWriter", "addHeaderAlias", "(", "String", "name", ",", "String", "alias", ")", "{", "Map", "<", "String", ",", "String", ">", "headerAlias", "=", "this", ".", "headerAlias", ";", "if", "(", "null", "==", "headerAlias", ")", "{", "headerAlia...
增加标题别名 @param name 原标题 @param alias 别名 @return this @since 4.1.5
[ "增加标题别名" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L412-L420
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_easyHunting_serviceName_timeConditions_PUT
public void billingAccount_easyHunting_serviceName_timeConditions_PUT(String billingAccount, String serviceName, OvhEasyHuntingTimeConditionsSettings body) throws IOException { """ Alter this object properties REST: PUT /telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions @param body [required]...
java
public void billingAccount_easyHunting_serviceName_timeConditions_PUT(String billingAccount, String serviceName, OvhEasyHuntingTimeConditionsSettings body) throws IOException { String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions"; StringBuilder sb = path(qPath, billingAccount, servi...
[ "public", "void", "billingAccount_easyHunting_serviceName_timeConditions_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhEasyHuntingTimeConditionsSettings", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAc...
Alter this object properties REST: PUT /telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3422-L3426
aws/aws-sdk-java
aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeDeploymentJobResult.java
DescribeDeploymentJobResult.withTags
public DescribeDeploymentJobResult withTags(java.util.Map<String, String> tags) { """ <p> The list of all tags added to the specified deployment job. </p> @param tags The list of all tags added to the specified deployment job. @return Returns a reference to this object so that method calls can be chained to...
java
public DescribeDeploymentJobResult withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "DescribeDeploymentJobResult", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> The list of all tags added to the specified deployment job. </p> @param tags The list of all tags added to the specified deployment job. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "list", "of", "all", "tags", "added", "to", "the", "specified", "deployment", "job", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeDeploymentJobResult.java#L580-L583
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java
IOGroovyMethods.filterLine
public static Writable filterLine(Reader reader, final @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) { """ Filter the lines from this Reader, and return a Writable which can be used to stream the filtered lines to a destination. The closure should return <code>true</code> i...
java
public static Writable filterLine(Reader reader, final @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) { final BufferedReader br = new BufferedReader(reader); return new Writable() { public Writer writeTo(Writer out) throws IOException { Bu...
[ "public", "static", "Writable", "filterLine", "(", "Reader", "reader", ",", "final", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"java.lang.String\"", ")", "Closure", "closure", ")", "{", "final", "BufferedReader",...
Filter the lines from this Reader, and return a Writable which can be used to stream the filtered lines to a destination. The closure should return <code>true</code> if the line should be passed to the writer. @param reader this reader @param closure a closure used for filtering @return a Writable which will use the...
[ "Filter", "the", "lines", "from", "this", "Reader", "and", "return", "a", "Writable", "which", "can", "be", "used", "to", "stream", "the", "filtered", "lines", "to", "a", "destination", ".", "The", "closure", "should", "return", "<code", ">", "true<", "/",...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1511-L1538
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java
ObjectUtils.shallowCopy
public static void shallowCopy(Object source, Object target, final String... propertyNames) { """ Makes a shallow copy of the source object into the target one excluding properties not in <code>propertyNames</code>. <p> This method differs from {@link ReflectionUtils#shallowCopyFieldState(Object, Object)} this ...
java
public static void shallowCopy(Object source, Object target, final String... propertyNames) { ObjectUtils.doShallowCopy(source, target, Boolean.FALSE, propertyNames); }
[ "public", "static", "void", "shallowCopy", "(", "Object", "source", ",", "Object", "target", ",", "final", "String", "...", "propertyNames", ")", "{", "ObjectUtils", ".", "doShallowCopy", "(", "source", ",", "target", ",", "Boolean", ".", "FALSE", ",", "prop...
Makes a shallow copy of the source object into the target one excluding properties not in <code>propertyNames</code>. <p> This method differs from {@link ReflectionUtils#shallowCopyFieldState(Object, Object)} this doesn't require source and target objects to share the same class hierarchy. @param source the source obj...
[ "Makes", "a", "shallow", "copy", "of", "the", "source", "object", "into", "the", "target", "one", "excluding", "properties", "not", "in", "<code", ">", "propertyNames<", "/", "code", ">", ".", "<p", ">", "This", "method", "differs", "from", "{", "@link", ...
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java#L136-L139
versionone/VersionOne.SDK.Java.ObjectModel
src/main/java/com/versionone/om/Project.java
Project.createRetrospective
public Retrospective createRetrospective(String name, Map<String, Object> attributes) { """ Create a new Retrospective in this Project. @param name The initial name of the Retrospective. @param attributes additional attributes for Retrospective. @return A new Retrospective. """ return getIns...
java
public Retrospective createRetrospective(String name, Map<String, Object> attributes) { return getInstance().create().retrospective(name, this, attributes); }
[ "public", "Retrospective", "createRetrospective", "(", "String", "name", ",", "Map", "<", "String", ",", "Object", ">", "attributes", ")", "{", "return", "getInstance", "(", ")", ".", "create", "(", ")", ".", "retrospective", "(", "name", ",", "this", ",",...
Create a new Retrospective in this Project. @param name The initial name of the Retrospective. @param attributes additional attributes for Retrospective. @return A new Retrospective.
[ "Create", "a", "new", "Retrospective", "in", "this", "Project", "." ]
train
https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L335-L337
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java
EM.assignProbabilitiesToInstances
public static double assignProbabilitiesToInstances(Relation<? extends NumberVector> relation, List<? extends EMClusterModel<?>> models, WritableDataStore<double[]> probClusterIGivenX) { """ Assigns the current probability values to the instances in the database and compute the expectation value of the current mi...
java
public static double assignProbabilitiesToInstances(Relation<? extends NumberVector> relation, List<? extends EMClusterModel<?>> models, WritableDataStore<double[]> probClusterIGivenX) { final int k = models.size(); double emSum = 0.; for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advan...
[ "public", "static", "double", "assignProbabilitiesToInstances", "(", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ",", "List", "<", "?", "extends", "EMClusterModel", "<", "?", ">", ">", "models", ",", "WritableDataStore", "<", "double", "[",...
Assigns the current probability values to the instances in the database and compute the expectation value of the current mixture of distributions. Computed as the sum of the logarithms of the prior probability of each instance. @param relation the database used for assignment to instances @param models Cluster models...
[ "Assigns", "the", "current", "probability", "values", "to", "the", "instances", "in", "the", "database", "and", "compute", "the", "expectation", "value", "of", "the", "current", "mixture", "of", "distributions", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java#L336-L355
apereo/cas
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpRequestUtils.java
HttpRequestUtils.doesParameterExist
public static boolean doesParameterExist(final HttpServletRequest request, final String name) { """ Check if a parameter exists. @param request the HTTP request @param name the parameter name @return whether the parameter exists """ val parameter = request.getParameter(name); if (String...
java
public static boolean doesParameterExist(final HttpServletRequest request, final String name) { val parameter = request.getParameter(name); if (StringUtils.isBlank(parameter)) { LOGGER.error("Missing request parameter: [{}]", name); return false; } LOGGER.debug("F...
[ "public", "static", "boolean", "doesParameterExist", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "name", ")", "{", "val", "parameter", "=", "request", ".", "getParameter", "(", "name", ")", ";", "if", "(", "StringUtils", ".", "isBlan...
Check if a parameter exists. @param request the HTTP request @param name the parameter name @return whether the parameter exists
[ "Check", "if", "a", "parameter", "exists", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpRequestUtils.java#L145-L153
zeroturnaround/zt-exec
src/main/java/org/zeroturnaround/exec/stream/PumpStreamHandler.java
PumpStreamHandler.createPump
protected Thread createPump(InputStream is, OutputStream os, boolean closeWhenExhausted, boolean flushImmediately) { """ Creates a stream pumper to copy the given input stream to the given output stream. @param is the input stream to copy from @param os the output stream to copy into @param closeWhenExhauste...
java
protected Thread createPump(InputStream is, OutputStream os, boolean closeWhenExhausted, boolean flushImmediately) { return newThread(new StreamPumper(is, os, closeWhenExhausted, flushImmediately)); }
[ "protected", "Thread", "createPump", "(", "InputStream", "is", ",", "OutputStream", "os", ",", "boolean", "closeWhenExhausted", ",", "boolean", "flushImmediately", ")", "{", "return", "newThread", "(", "new", "StreamPumper", "(", "is", ",", "os", ",", "closeWhen...
Creates a stream pumper to copy the given input stream to the given output stream. @param is the input stream to copy from @param os the output stream to copy into @param closeWhenExhausted close the output stream when the input stream is exhausted @param flushImmediately flush the output stream whenever data was writ...
[ "Creates", "a", "stream", "pumper", "to", "copy", "the", "given", "input", "stream", "to", "the", "given", "output", "stream", "." ]
train
https://github.com/zeroturnaround/zt-exec/blob/6c3b93b99bf3c69c9f41d6350bf7707005b6a4cd/src/main/java/org/zeroturnaround/exec/stream/PumpStreamHandler.java#L338-L340
dropwizard/dropwizard
dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/MapBuilder.java
MapBuilder.addTimestamp
public MapBuilder addTimestamp(String fieldName, boolean include, long timestamp) { """ Adds and optionally formats the timestamp to the provided map under the provided field name, if it's should be included. """ if (include && timestamp > 0) { map.put(getFieldName(fieldName), timestampFor...
java
public MapBuilder addTimestamp(String fieldName, boolean include, long timestamp) { if (include && timestamp > 0) { map.put(getFieldName(fieldName), timestampFormatter.format(timestamp)); } return this; }
[ "public", "MapBuilder", "addTimestamp", "(", "String", "fieldName", ",", "boolean", "include", ",", "long", "timestamp", ")", "{", "if", "(", "include", "&&", "timestamp", ">", "0", ")", "{", "map", ".", "put", "(", "getFieldName", "(", "fieldName", ")", ...
Adds and optionally formats the timestamp to the provided map under the provided field name, if it's should be included.
[ "Adds", "and", "optionally", "formats", "the", "timestamp", "to", "the", "provided", "map", "under", "the", "provided", "field", "name", "if", "it", "s", "should", "be", "included", "." ]
train
https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/MapBuilder.java#L116-L121
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java
HttpUtil.setKeepAlive
public static void setKeepAlive(HttpMessage message, boolean keepAlive) { """ Sets the value of the {@code "Connection"} header depending on the protocol version of the specified message. This getMethod sets or removes the {@code "Connection"} header depending on what the default keep alive mode of the message'...
java
public static void setKeepAlive(HttpMessage message, boolean keepAlive) { setKeepAlive(message.headers(), message.protocolVersion(), keepAlive); }
[ "public", "static", "void", "setKeepAlive", "(", "HttpMessage", "message", ",", "boolean", "keepAlive", ")", "{", "setKeepAlive", "(", "message", ".", "headers", "(", ")", ",", "message", ".", "protocolVersion", "(", ")", ",", "keepAlive", ")", ";", "}" ]
Sets the value of the {@code "Connection"} header depending on the protocol version of the specified message. This getMethod sets or removes the {@code "Connection"} header depending on what the default keep alive mode of the message's protocol version is, as specified by {@link HttpVersion#isKeepAliveDefault()}. <ul> ...
[ "Sets", "the", "value", "of", "the", "{" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L93-L95
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggerHistoriesInner.java
WorkflowTriggerHistoriesInner.listAsync
public Observable<Page<WorkflowTriggerHistoryInner>> listAsync(final String resourceGroupName, final String workflowName, final String triggerName, final Integer top, final String filter) { """ Gets a list of workflow trigger histories. @param resourceGroupName The resource group name. @param workflowName The ...
java
public Observable<Page<WorkflowTriggerHistoryInner>> listAsync(final String resourceGroupName, final String workflowName, final String triggerName, final Integer top, final String filter) { return listWithServiceResponseAsync(resourceGroupName, workflowName, triggerName, top, filter) .map(new Func1<...
[ "public", "Observable", "<", "Page", "<", "WorkflowTriggerHistoryInner", ">", ">", "listAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "workflowName", ",", "final", "String", "triggerName", ",", "final", "Integer", "top", ",", "final"...
Gets a list of workflow trigger histories. @param resourceGroupName The resource group name. @param workflowName The workflow name. @param triggerName The workflow trigger name. @param top The number of items to be included in the result. @param filter The filter to apply on the operation. Options for filters include:...
[ "Gets", "a", "list", "of", "workflow", "trigger", "histories", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggerHistoriesInner.java#L263-L271