code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public Evse updateEvse(Long chargingStationTypeId, Evse evse) {
ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId);
Evse existingEvse = getEvseById(chargingStationType, evse.getId());
c... | Create a Java method that does the following: "Update an evse in the charging station type". |
Of course, here is the Java code you requested:
```java
private void put(DirectoryEntry entry, boolean overwriteExisting) {
int index = bucketIndex(entry.name(), table.length);
// find the place the new entry should go, ensuring an entry with the same name doesn't already
// exist along the way
Direct... | Create a Java method that does the following: "Put an entry into the table.". |
Of course, here is the Java code you requested:
```java
public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException {
if (!(nameClassPair instanceof Binding)) {
throw new IllegalArgumentException("Parameter must be an instance of Binding");
}
Binding binding = (Binding) nameClassP... | Create a Java method that does the following: "Get an object from a name class pair.". |
Of course, here is the Java code you requested:
```java
public static int getMaxIntersectionBytes(final int nomEntries) {
final int nomEnt = ceilingPowerOf2(nomEntries);
final int bytes = (nomEnt << 4) + (Family.INTERSECTION.getMaxPreLongs() << 3);
return bytes;
}
```
Hope this helps! | Create a Java method that does the following: "Get the max intersection bytes.". |
Of course, here is the Java code you requested:
```java
public static BitfinexOrderBookSymbol fromJSON(final JSONObject jsonObject) {
BitfinexCurrencyPair symbol = BitfinexCurrencyPair.fromSymbolString(jsonObject.getString("symbol"));
Precision prec = Precision.valueOf(jsonObject.getString("prec"));
Frequency fr... | Create a Java method that does the following: "Create a BitfinexOrderBookSymbol from a json object". |
Of course, here is the Java code you requested:
```java
@Override
public UpdateRuntimeConfigurationResult updateRuntimeConfiguration(UpdateRuntimeConfigurationRequest request) {
request = beforeClientExecution(request);
return executeUpdateRuntimeConfiguration(request);
}
```
Hope this helps! | Create a Java method that does the following: "Updates the runtime configuration for a specific class.". |
Of course, here is the Java code you requested:
```java
public int[] getIC()
{
int[] ic = new int[nzmax];
int i = 0;
for ( IndexMN index : indexSet )
{
ic[i++] = index.n;
}
return ic;
}
```
Hope this helps! | Create a Java method that does the following: "Get the array of the exception classes.". |
Of course, here is the Java code you requested:
```java
public static <T> Iterable<T> nullSafeIterable(Iterable<T> iterable) {
return (iterable != null) ? iterable : Collections.EMPTY_LIST;
}
```
Hope this helps! | Create a Java method that does the following: "Null safe iterable.". |
Of course, here is the Java code you requested:
```java
public AccessToken obtainAccessTokenByToken(String accessToken) throws InvalidTokenException, TokenExpiredException{
String key = "obtainAccessTokenByToken:"+accessToken;
AccessToken token = getAccessTokenFromCache(key);
if (token != null)... | Create a Java method that does the following: "obtainAccessTokenByToken This method is used to obtain an access token from the cache.". |
Of course, here is the Java code you requested:
```java
private static int scanBaseTypeSignature(String string, int start) {
// need a minimum 1 char
if (start >= string.length()) {
throw new IllegalArgumentException();
}
char c = string.charAt(start);
if ("BCDFIJSVZ".indexOf(c) >= 0) { //$NON-NLS-1$
r... | Create a Java method that does the following: "Scan a base type signature.". |
Of course, here is the Java code you requested:
```java
@Override
public int filterObject(CaptureSearchResult r) {
if(!notifiedSeen) {
if(filterGroup != null) {
filterGroup.setSawAdministrative();
}
notifiedSeen = true;
}
String surt;
try {
String url = canonicalizer.urlStringToKey(r.getOrigi... | Create a Java method that does the following: "Filter an object.". |
Of course, here is the Java code you requested:
```java
public com.google.protobuf.ByteString
getVmNameBytes() {
java.lang.Object ref = vmName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang... | Create a Java method that does the following: "Gets the value of the vmName_ field.". |
Of course, here is the Java code you requested:
```java
public Operation detachDisk(String deviceName, OperationOption... options) {
return compute.detachDisk(getInstanceId(), deviceName, options);
}
```
Hope this helps! | Create a Java method that does the following: "Detach a disk from the instance.". |
Of course, here is the Java code you requested:
```java
public void marshall(DomainSuggestion domainSuggestion, ProtocolMarshaller protocolMarshaller) {
if (domainSuggestion == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
pr... | Create a Java method that does the following: "marshalls the given domain suggestion to the JSON object.". |
Of course, here is the Java code you requested:
```java
@Override
public void writeFragmentTo(MwsWriter w) {
w.write("CurrencyCode", currencyCode);
w.write("Amount", amount);
}
```
Hope this helps! | Create a Java method that does the following: "Write the content of the CID to the given writer.". |
Of course, here is the Java code you requested:
```java
private static String getVersionFromJar(final Path path) {
Matcher matcher = JAR_VERSION.matcher(path.toString());
if (matcher.matches()) {
return matcher.group(1);
} else {
Logger.error("JAR file \"{}\" does not contain a version", path);
return n... | Create a Java method that does the following: "Gets the version from the jar file.". |
Of course, here is the Java code you requested:
```java
private static void checkLineFeed(final InputStream input,
final ByteArrayOutputStream baos, final Integer position)
throws IOException {
if (input.read() != '\n') {
throw new HttpException(
HttpURLConnection.HT... | Create a Java method that does the following: "Check if the input stream contains a LF after CR.". |
Of course, here is the Java code you requested:
```java
public static String getShardKeyByDRDS(final JdbcTemplate jdbcTemplate, final String catalogName,
final String schemaName, final String tableName) {
try {
return (String) jdbcTemplate.execute("show p... | Create a Java method that does the following: "Get the shard key by the DRDS.". |
Of course, here is the Java code you requested:
```java
public FormValidation doCheckViewName(@QueryParameter String value) {
checkPermission(View.CREATE);
String name = fixEmpty(value);
if (name == null)
return FormValidation.ok();
// already exists?
if (getView(n... | Create a Java method that does the following: "Check the view name.". |
Of course, here is the Java code you requested:
```java
public Stat exists(String path, boolean watch) throws KeeperException,
InterruptedException {
verbotenThreadCheck();
return exists(path, watch ? watchManager.defaultWatcher : null);
}
```
Hope this helps! | Create a Java method that does the following: "Check if a path exists.". |
Of course, here is the Java code you requested:
```java
public static void runInFXAndWait(Runnable doRun) {
if (Platform.isFxApplicationThread()) {
doRun.run();
return;
}
final CountDownLatch doneLatch = new CountDownLatch(1);
Platform.runLater(() -> {
... | Create a Java method that does the following: "Run inFX and wait.". |
Of course, here is the Java code you requested:
```java
public static GetRestoreTaskParameters deserialize(String taskParameters) {
JaxbJsonSerializer<GetRestoreTaskParameters> serializer =
new JaxbJsonSerializer<>(GetRestoreTaskParameters.class);
try {
GetRestoreTaskParameters ... | Create a Java method that does the following: "Deserialize a single snapshot task parameters string.". |
Of course, here is the Java code you requested:
```java
public void sendWithBulkProcessor(Map<String, ?> source, String index,
String type) {
sendWithBulkProcessor(source, index, type, null);
}
```
Hope this helps! | Create a Java method that does the following: "Send with bulk processor.". |
Of course, here is the Java code you requested:
```java
private void internalFind(
SearchComparator comp,
Object searchKey,
SearchNode point)
{
GBSNode p = root();
GBSNode l = null;
GBS... | Create a Java method that does the following: "Internal Find method.". |
Of course, here is the Java code you requested:
```java
public static com.liferay.commerce.product.model.CPDefinitionOptionRel getCPDefinitionOptionRelByUuidAndGroupId(
String uuid, long groupId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getCPDefinitionOptionRelByUu... | Create a Java method that does the following: "Returns the cp definition option rel matching the UUID and group.". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = AppendContentStreamResponse.class)
public JAXBElement<CmisExtensionType> createAppendContentStreamResponseExtension(
CmisExtensionType value) {
... | Create a Java method that does the following: "Create an instance of CmisExtensionType in the given type of AppendContentStreamResponse.". |
Of course, here is the Java code you requested:
```java
public CompletableFuture<Revision> updateTokenRole(Author author, String projectName,
Token token, ProjectRole role) {
requireNonNull(author, "author");
requireNonNull(projectName, "projectNam... | Create a Java method that does the following: "Update the role of a token.". |
Of course, here is the Java code you requested:
```java
@Override
@Nullable
public AccessToken getAccessToken() {
long expiresIn;
String token;
Set<String> scopesString;
String refreshToken;
String tokenType;
try {
expiresIn = sharedPreferences.getL... | Create a Java method that does the following: "Get the access token.". |
Of course, here is the Java code you requested:
```java
protected void scanDir(File srcDir, File destDir, String[] files, String ext)
{
// If no source path was specified, we effectively created one by adding the generation
// path. Because of this, we need to be sure and add all source dirs to the path too.
... | Create a Java method that does the following: "Scan a directory for source files and compile files.". |
Of course, here is the Java code you requested:
```java
@Override
public XBELAnnotation convert(Annotation source) {
if (source == null) return null;
AnnotationDefinition definition = source.getDefinition();
String refID = definition.getId();
String value = source.getValue();
... | Create a Java method that does the following: "Converts an annotation to a XBELAnnotation.". |
Of course, here is the Java code you requested:
```java
private static void receiveMessageResultMd5Check(ReceiveMessageResult receiveMessageResult) {
if (receiveMessageResult.getMessages() != null) {
for (Message messageReceived : receiveMessageResult.getMessages()) {
String message... | Create a Java method that does the following: "Check if the receive message result has the correct MD5 values.". |
Of course, here is the Java code you requested:
```java
public void waitUntil(Sampler<Boolean> variable, Ticker ticker) {
waitUntil(variable, ticker, isQuietlyTrue());
}
```
Hope this helps! | Create a Java method that does the following: "Wait until a variable is encountered.". |
Of course, here is the Java code you requested:
```java
public List<T> getElements() {
ArrayList<T> list = new ArrayList<>(nodes.size());
for (Node<T> node : nodes)
list.add(node.element);
return list;
}
/** Return the number of elements. */
public int size() { return nodes.size(); }
}
```
Hope this h... | Create a Java method that does the following: "Returns a list of elements in the graph.". |
Of course, here is the Java code you requested:
```java
static public void closeSession(LoginInput loginInput)
throws SFException, SnowflakeSQLException
{
logger.debug(" public void close() throws SFException");
// assert the following inputs are valid
AssertUtil.assertTrue(loginInput.getServerUrl() !... | Create a Java method that does the following: "Close the session". |
Of course, here is the Java code you requested:
```java
public Map<String, Object> flattenAsMap() {
if (flattenedMap != null) return flattenedMap;
flattenedMap = newJsonifyLinkedHashMap();
reduce(source);
while (!elementIters.isEmpty()) {
IndexedPeekIterator<?> deepestIter = elementIters.getLas... | Create a Java method that does the following: "Flatten the source as a map.". |
Of course, here is the Java code you requested:
```java
public void reallocate(boolean allMsgs) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "reallocate");
// There will not be a reallocator if this streamSet is used for PubSub
i... | Create a Java method that does the following: "This method is called by the MessageStore to reallocate the messages in the itemstream.". |
Of course, here is the Java code you requested:
```java
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<AnnotatedDataset, LabelOperationMetadata> labelTextAsync(
LabelTextRequest request) {
return labelTextOperationCall... | Create a Java method that does the following: "Asynchronously labels a dataset using the label text format.". |
Of course, here is the Java code you requested:
```java
public boolean canBePreempted(String pool) {
Boolean result = canBePreempted.get(pool);
return result == null ? true : result; // Default is true
}
```
Hope this helps! | Create a Java method that does the following: "Returns true if the pool can be preempted.". |
Of course, here is the Java code you requested:
```java
public void writeString(final String value, final JBBPByteOrder order) throws IOException {
if (value == null) {
this.write(0xFF);
} else if (value.length() == 0) {
this.write(0);
} else {
final byte[] array = JBBPUtils.strToUtf8(val... | Create a Java method that does the following: "Write string to the stream.". |
Of course, here is the Java code you requested:
```java
private static IndexedInts getRow(ColumnValueSelector s)
{
if (s instanceof DimensionSelector) {
return ((DimensionSelector) s).getRow();
} else if (s instanceof NilColumnValueSelector) {
return ZeroIndexedInts.instance();
} else {
... | Create a Java method that does the following: "Get the row of the ColumnValueSelector". |
Of course, here is the Java code you requested:
```java
public static CmsUUID convertUUID(Object input) {
CmsUUID uuid;
if (input instanceof CmsUUID) {
uuid = (CmsUUID)input;
} else if (input instanceof byte[]) {
uuid = new CmsUUID((byte[])input);
}
```
Hope th... | Create a Java method that does the following: "Convert a UUID to a CmsResource.". |
Of course, here is the Java code you requested:
```java
private boolean isRunOnce(final ServletRequest pRequest) {
// If request already filtered, return true (skip)
if (pRequest.getAttribute(attribRunOnce) == ATTRIB_RUN_ONCE_VALUE) {
return true;
}
// Set attribute a... | Create a Java method that does the following: "Checks if the request attribute is run once.". |
Of course, here is the Java code you requested:
```java
public Builder newCopyBuilder() {
return new Builder(getInputFormat(), getOutputFormat(), getActivity()).locale(getLocale()).setRequiredOptions(keys);
}
```
Hope this helps! | Create a Java method that does the following: "Create a new copy builder.". |
Of course, here is the Java code you requested:
```java
public ExpressionBuilder notNullOrEmpty(final Object property, final String name) {
notNull(property, name);
if (property instanceof String && ((String) property).isEmpty()) {
messageContainer.addErrorMessage("Property '" + name + "'... | Create a Java method that does the following: "Check that the property is not null or empty and contains elements.". |
Of course, here is the Java code you requested:
```java
public static void generate(ConfigurationImpl configuration,
ClassUseMapper mapper, ClassDoc classdoc) {
ClassUseWriter clsgen;
DocPath path = DocPath.forPackage(classdoc)
.resolve(DocPaths.CLASS_USE... | Create a Java method that does the following: "Generate the class use file.". |
Of course, here is the Java code you requested:
```java
public String route(String method, String var1, Object value1) {
return route(controller.getClass().getName(), method, var1, value1);
}
```
Hope this helps! | Create a Java method that does the following: "Route a controller to the specified method.". |
Of course, here is the Java code you requested:
```java
public static @NotNull Resource getSyntheticLinkResource(@NotNull ResourceResolver resourceResolver, @NotNull String pageRef) {
Map<String, Object> map = new HashMap<>();
map.put(LinkNameConstants.PN_LINK_TYPE, ID);
map.put(LinkNameConstants.PN_LINK_C... | Create a Java method that does the following: "Gets a synthetic link resource.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("SameParameterValue") // Using same method params as in restrictStateBounds
@Nullable
State restrictStateBoundsCopy(State state, State prevState, float pivotX, float pivotY,
boolean allowOverscroll, boolean allowOverzoom, boo... | Create a Java method that does the following: "Restrict the state bounds to the bounds of the state.". |
Of course, here is the Java code you requested:
```java
public CmsContainerElementBean getCurrentElement(ServletRequest req) throws CmsException {
CmsJspStandardContextBean sCBean = CmsJspStandardContextBean.getInstance(req);
CmsContainerElementBean element = sCBean.getElement();
if (element =... | Create a Java method that does the following: "Returns the current element from the context bean.". |
Of course, here is the Java code you requested:
```java
private void initAttributes(final AbstractAttribute... attributes) {
if (attributes == null || attributes.length == 0) {
return;
}
// initial capacity must be greater than 1 instead of 1
// because the load factor is ... | Create a Java method that does the following: "Initialize the attributes.". |
Of course, here is the Java code you requested:
```java
public void add(ApplicationWindow window) {
if (activeWindow == null) // first window will be set as activeWindow
setActiveWindow(window);
if (!windows.contains(window)) {
windows.add(window);
window.setWindowM... | Create a Java method that does the following: "Add a window to the application.". |
Of course, here is the Java code you requested:
```java
public Point getLocation() {
JSONObject result =
(JSONObject) driver.executeAtom(AndroidAtoms.GET_TOP_LEFT_COORDINATES, null, this);
try {
return new Point(result.getInt("x"), result.getInt("y"));
} catch (JSONException e) {
throw... | Create a Java method that does the following: "Get the location of the top left corner of the page.". |
Of course, here is the Java code you requested:
```java
public String formatMessage(RepositoryLogRecord record, Locale tmpLocale) {
// no localization case (CBE or non-CBE)
if (record.getLocalizable() == WsLogRecord.REQUIRES_NO_LOCALIZATION) {
String traceString = record.getRawMessage(); //... | Create a Java method that does the following: "Format the message for the specified repositoryLogRecord.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public T reduce(T value1, T value2) throws Exception {
for (int position : fields) {
// Save position of compared key
// Get both values - both implement comparable
Comparable comparable1 = va... | Create a Java method that does the following: "Reduce two objects.". |
Of course, here is the Java code you requested:
```java
private static void addFeatures(Featurable featurable, Services services, Setup setup)
{
final List<Feature> rawFeatures = FeaturableConfig.getFeatures(services, setup);
final int length = rawFeatures.size();
for (int i = 0; i < le... | Create a Java method that does the following: "Add features to the featurable.". |
Of course, here is the Java code you requested:
```java
private void resolveTemporaryProperties(Map<String, Set<String>> map) {
boolean temporaryPresent = false;
do {
temporaryPresent = false;
for (Map.Entry<String, Set<String>> entry : map.entrySet()) {
Set<Stri... | Create a Java method that does the following: "Resolve temporary properties.". |
Of course, here is the Java code you requested:
```java
public @CheckForNull Queue.Executable getCurrentExecutable() {
lock.readLock().lock();
try {
return executable;
} finally {
lock.readLock().unlock();
}
}
```
Hope this helps! | Create a Java method that does the following: "Gets the current executable.". |
Of course, here is the Java code you requested:
```java
public static boolean intersectRaySphere(Rayd ray, Spheref sphere, Vector2d result) {
return intersectRaySphere(ray.oX, ray.oY, ray.oZ, ray.dX, ray.dY, ray.dZ, sphere.x, sphere.y, sphere.z, sphere.r*sphere.r, result);
}
```
Hope this helps! | Create a Java method that does the following: "Intersects the ray with the sphere.". |
Of course, here is the Java code you requested:
```java
public Variable findVariableOrInParent(String varShortName) {
if (varShortName == null) return null;
Variable v = findVariable(varShortName);
Group parent = getParentGroup();
if ((v == null) && (parent != null))
v = parent.findVariableOrInP... | Create a Java method that does the following: "Find a variable in this group or in the parent group.". |
Of course, here is the Java code you requested:
```java
public void start() {
if (hasVibratePermission(mContext)) {
mVibrator = (Vibrator) mContext.getSystemService(Service.VIBRATOR_SERVICE);
}
// Setup a listener for changes in haptic feedback settings
mIsGloballyEnabled =... | Create a Java method that does the following: "Start the application.". |
Of course, here is the Java code you requested:
```java
private byte[][] toByteArrays(final byte[] keyspace, final byte[] uid, final byte[] serviceCode, final byte[][] key) {
final byte[][] allArgs = new byte[key.length + 3][];
int index = 0;
allArgs[index++] = keyspace;
allArgs[index++... | Create a Java method that does the following: "Converts a byte array to a byte array of bytes.". |
Of course, here is the Java code you requested:
```java
private static void indexPictureInMap(final Map<String, Picture> picMap,
final XSSFSheet sheet, final POIXMLDocumentPart dr) {
if (dr instanceof XSSFDrawing) {
XSSFDrawing drawing = (XSSFDrawing) dr;
List<XSSFShape> shapes = drawing.getShapes();
... | Create a Java method that does the following: "Index the picture in the map.". |
Of course, here is the Java code you requested:
```java
public Collection<AlertChannel> list(List<String> queryParams)
{
return HTTP.GET("/v2/alerts_channels.json", null, queryParams, ALERT_CHANNELS).get();
}
```
Hope this helps! | Create a Java method that does the following: "Returns the set of alert channels with the given query parameters.". |
Of course, here is the Java code you requested:
```java
int drainTo(int[] target, int maxElements) {
// non volatile read ( which is quicker )
int readLocation = this.consumerReadLocation;
int i = 0;
// to reduce the number of volatile reads we are going to perform a kind of double ... | Create a Java method that does the following: "Drains the array of elements from this buffer to the target array.". |
Of course, here is the Java code you requested:
```java
public Multipart field(String name, String value){
formFields.add(new FormField(name, value));
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Adds a form field to the request.". |
Of course, here is the Java code you requested:
```java
public void setNames(java.util.Collection<String> names) {
if (names == null) {
this.names = null;
return;
}
this.names = new com.amazonaws.internal.SdkInternalList<String>(names);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value of the names property.". |
Of course, here is the Java code you requested:
```java
public Observable<KeyBundle> createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty) {
return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty).map(new Func1<ServiceResponse<KeyBundle>, KeyBundle>() {
@Override
... | Create a Java method that does the following: "Creates a new key in a specified key vault.". |
Of course, here is the Java code you requested:
```java
private List<Policy> aggregateContractPolicies(ContractSummaryBean contractBean) {
try {
List<Policy> policies = new ArrayList<>();
PolicyType [] types = new PolicyType[] {
PolicyType.Client, PolicyType.Plan, Po... | Create a Java method that does the following: "Aggregate the policies for a contract.". |
Of course, here is the Java code you requested:
```java
public boolean remove(String mem){
try {
return getJedisCommands(groupName).zrem(key,mem) >= 1;
} finally{
getJedisProvider(groupName).release();
}
}
```
Hope this helps! | Create a Java method that does the following: "Removes the element from the set.". |
Of course, here is the Java code you requested:
```java
public ODatabaseDocumentTx delete(final ODocument iRecord) {
if (iRecord == null)
throw new ODatabaseException("Cannot delete null document");
// CHECK ACCESS ON SCHEMA CLASS NAME (IF ANY)
if (iRecord.getClassName() != null)
checkSe... | Create a Java method that does the following: "Delete a single SECTYPE from the database.". |
Of course, here is the Java code you requested:
```java
public Iterator<Symbol> iterator() {
return new Iterator<Symbol>() {
/** The next entry to examine, or null if none. */
private Scope.Entry nextEntry = scope.elems;
private boolean hasNextForSure = false;
... | Create a Java method that does the following: "Returns an iterator over the elements in this scope.". |
Of course, here is the Java code you requested:
```java
public CmsResource getTarget(CmsObject cms, CmsResourceFilter filter) throws CmsException {
try {
// first look up by id
return cms.readResource(getTargetId(), filter);
} catch (CmsVfsResourceNotFoundException e) {
... | Create a Java method that does the following: "Gets the target resource.". |
Of course, here is the Java code you requested:
```java
public static void main(String[] args) throws TwitterException {
TwitterStream twitterStream = new TwitterStreamFactory().getInstance().addListener(new RawStreamListener() {
@Override
public void onMessage(String rawJSON) {
... | Create a Java method that does the following: "Example of the CIDIVA test.". |
Of course, here is the Java code you requested:
```java
@Override
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
return cpSpecificationOptionPersistence.findWithDynamicQuery(dynamicQuery);
}
```
Hope this helps! | Create a Java method that does the following: "Executes a dynamic query on the database. Also notifies the appropriate model listeners.". |
Of course, here is the Java code you requested:
```java
public CommandLine setStopAtPositional(boolean newValue) {
getCommandSpec().parser().stopAtPositional(newValue);
for (CommandLine command : getCommandSpec().subcommands().values()) {
command.setStopAtPositional(newValue);
}
... | Create a Java method that does the following: "Sets the stop at positional flag.". |
Of course, here is the Java code you requested:
```java
@CheckForNull
public Date getDate(String key) {
String value = getString(key);
if (StringUtils.isNotEmpty(value)) {
return DateUtils.parseDate(value);
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Get a Date value from the NCBI NIST header.". |
Of course, here is the Java code you requested:
```java
@Override
protected void notifyDispatcher() {
if (threads != null) {
synchronized (threads) {
threads.notifyAll();
for (Thread thread : threads) {
((DispatcherThread) thread).setChanged(t... | Create a Java method that does the following: "Notify all the dispatcher threads.". |
Of course, here is the Java code you requested:
```java
public void set_value(String[] p_data,int x,int y) throws DevFailed
{
//
// Throw exception if type is not correct.
//
if (data_type != Tango_DEV_STRING)
{
StringBuffer o = new StringBuffer("Invalid data type for attribute ");
o.append(name);
Exce... | Create a Java method that does the following: "Set the value of an attribute". |
Of course, here is the Java code you requested:
```java
private boolean hasToBuilderMethod(
DeclaredType builder,
boolean isExtensible,
Iterable<ExecutableElement> methods) {
for (ExecutableElement method : methods) {
if (isToBuilderMethod(builder, method)) {
if (!isExtensible) {
... | Create a Java method that does the following: "Checks if a method is a toBuilder method.". |
Of course, here is the Java code you requested:
```java
public OperationStatus deleteHierarchicalEntityRole(UUID appId, String versionId, UUID hEntityId, UUID roleId) {
return deleteHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId).toBlocking().single().body();
}
```
Hope... | Create a Java method that does the following: "Deletes an entity role from an app.". |
Of course, here is the Java code you requested:
```java
public boolean isMultiSelectable() {
return ((!isInPk() && !isInFk() && !isVersion()) || (isSimplePk() && jpa.isManuallyAssigned())) //
&& (isBoolean() || isEnum() || isString() || isNumeric());
}
```
Hope this helps! | Create a Java method that does the following: "Is this a multi - select operation?". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public TemplateWrapper[] getKnownTemplates() {
if (mTemplateOrdering == null) {
setTemplateOrdering("name");
}
Comparator<TemplateWrapper> comparator =
BeanComparator.forClass(Te... | Create a Java method that does the following: "Gets the list of templates that are known to be used in the application.". |
Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<ImageAnalysis>> analyzeImageInStreamWithServiceResponseAsync(byte[] image, AnalyzeImageInStreamOptionalParameter analyzeImageInStreamOptionalParameter) {
if (this.client.endpoint() == null) {
throw new Illegal... | Create a Java method that does the following: "Analyze an image in an image stream.". |
Of course, here is the Java code you requested:
```java
public StatementDocument performEdit(WbEditingAction action, boolean editAsBot, String summary)
throws IOException, MediaWikiApiErrorException {
if (isEmptyEdit()) {
return currentDocument;
} else if (toDelete.isEmpty() && getUpdatedStatements().size() ... | Create a Java method that does the following: "Performs an edit operation on the document.". |
Of course, here is the Java code you requested:
```java
private boolean impliesPath0(final String yourName) {
// segment-by-segment comparison
final String myName = getName();
final Iterator<String> myIter = JndiPermissionNameParser.nameIterator(myName);
final Iterator<String> yourIter ... | Create a Java method that does the following: "Checks if the path 0 implies the path 1.". |
Of course, here is the Java code you requested:
```java
@Override
public void createStoreIfAbsent(String storeName, boolean bBinaryValues) {
String tableName = storeToCQLName(storeName);
if (!storeExists(tableName)) {
new CQLSchemaManager(this).createCQLTable(storeName, bBinaryValues);
... | Create a Java method that does the following: "Create a store if it does not exist.". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<Void> stopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), service... | Create a Java method that does the following: "Stops an application Gateway.". |
Of course, here is the Java code you requested:
```java
@Override
public Response getApplicationBindings( String applicationName ) {
Response response;
ManagedApplication ma = this.manager.applicationMngr().findManagedApplicationByName( applicationName );
if( ma == null ) {
response = handleError(
Stat... | Create a Java method that does the following: "Returns the application bindings for the given application.". |
Of course, here is the Java code you requested:
```java
@Conditioned
@Et("Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\.|\\?]")
@And("I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\.|\\?]")
public void saveValue(String method, String pa... | Create a Java method that does the following: "Save value of REST API in context key.". |
Of course, here is the Java code you requested:
```java
public XmlReader createXMLReader(final String baseUri) throws KNXMLException
{
final XmlResolver res = new XmlResolver();
final InputStream is = (InputStream) res.resolveEntity(null, null, baseUri, null);
return create(res, is);
}
```
Hope this helps! | Create a Java method that does the following: "Create an XML reader.". |
Of course, here is the Java code you requested:
```java
public static String parseRoot(String zookeepers) {
int slashIndex = zookeepers.indexOf("/");
if (slashIndex != -1) {
return zookeepers.substring(slashIndex).trim();
}
return "/";
}
```
Hope this helps! | Create a Java method that does the following: "Parse the root of a Zookeeper path.". |
Of course, here is the Java code you requested:
```java
@Override
public final void execute() throws MojoExecutionException, MojoFailureException {
if (skipTests) {
if (session.getGoals().contains("jmeter:gui")) {
if (!"default-cli".equals(mojoExecution.getExecutionId()) && !"co... | Create a Java method that does the following: "Execute the generated code.". |
Of course, here is the Java code you requested:
```java
public Double getValueAsDoubleObject() {
if (this.getIsNull()) {
return null;
}
else if (this.value.equals("Infinity") || this.value.equals("INF")) {
return Double.POSITIVE_INFINITY;
}
else if (this.... | Create a Java method that does the following: "Gets the value as double object.". |
Of course, here is the Java code you requested:
```java
public boolean write(DataOutputStream daOut, boolean bFixedLength)
{
try {
Boolean boData = (Boolean)this.getData();
boolean bData;
if (boData == null)
bData = Boolean.FALSE.booleanValue(); // HACK... | Create a Java method that does the following: "Write the content of this object to the specified output stream.". |
Of course, here is the Java code you requested:
```java
@NoAuth
@RequestMapping(value = "/signin", method = RequestMethod.POST)
@ResponseBody
public JsonObjectBase signin(@Valid SigninForm signin, HttpServletRequest request) {
LOG.info(signin.toString());
// 验证
authValidator.valid... | Create a Java method that does the following: "Signin method for a user". |
Of course, here is the Java code you requested:
```java
public boolean extendsClassOrInterface(Types types,
TypeMirror typeMirror,
TypeMirror toImplement) {
String clearedToImplement = this.removeGenericsFromClassName(toImplement.toS... | Create a Java method that does the following: "Checks if the given typeMirror extends the given class or interface.". |
Of course, here is the Java code you requested:
```java
@Override
public void finish(IQueueMessage<ID, DATA> msg) {
if (!isEphemeralDisabled()) {
String key = msg.getId().toString();
rocksDbWrapper.delete(cfNameEphemeral, writeOptions, key);
}
}
```
Hope this helps! | Create a Java method that does the following: "Finishes a message.". |
Of course, here is the Java code you requested:
```java
public List<Long> searchPartially(File f, byte[] searchBytes, long startPosition, long maxSizeToRead) {
if (USE_NIO) {
return searchPartiallyUsingNIO(f, searchBytes, startPosition, maxSizeToRead, null);
} else {
return searchPartiallyUsingLegacy(f, sear... | Create a Java method that does the following: "Search for a sequence of bytes in the file starting at the given position.". |
Of course, here is the Java code you requested:
```java
public InvertibleMatrix inverse() throws MatrixException
{
InvertibleMatrix inverse = new InvertibleMatrix(nRows);
IdentityMatrix identity = new IdentityMatrix(nRows);
// Compute each column of the inverse matrix
// using c... | Create a Java method that does the following: "Returns the inverse matrix of this matrix.". |
Of course, here is the Java code you requested:
```java
public static int[] getRGB( BufferedImage image, int x, int y, int width, int height, int[] pixels ) {
int type = image.getType();
if ( type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB )
return (int [])image.getRaster().getDataElem... | Create a Java method that does the following: "Get the RGB values of the image.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.