code stringlengths 146 69.7k | prompt stringlengths 55 1.5k |
|---|---|
Of course, here is the Java code you requested:
```java
public boolean removePredecessor(Task targetTask, RelationType type, Duration lag)
{
boolean matchFound = false;
//
// Retrieve the list of predecessors
//
List<Relation> predecessorList = getPredecessors();
if (!predecesso... | Create a Java method that does the following: "Remove a predecessor relation from this task.". |
Of course, here is the Java code you requested:
```java
public static boolean isFlash(@Nullable String fileExtension) {
if (StringUtils.isEmpty(fileExtension)) {
return false;
}
return FLASH_FILE_EXTENSIONS.contains(fileExtension.toLowerCase());
}
```
Hope this helps! | Create a Java method that does the following: "Check if the file extension is a flash file extension". |
Of course, here is the Java code you requested:
```java
public static Pointer toBuffer(Buffer buffer)
{
if (buffer == null || (!buffer.isDirect() && !buffer.hasArray()))
{
throw new IllegalArgumentException(
"Buffer may not be null and must have an array or be direc... | Create a Java method that does the following: "Returns the absolute pointer of the given buffer from the base of the specified buffer.". |
Of course, here is the Java code you requested:
```java
public void marshall(DeletePermissionPolicyRequest deletePermissionPolicyRequest, ProtocolMarshaller protocolMarshaller) {
if (deletePermissionPolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
... | Create a Java method that does the following: "marshalls the given DeletePermissionPolicyRequest to the JSON - compatible way of invoking the marshall method.". |
Of course, here is the Java code you requested:
```java
public Object parse(Reader in, ContainerFactory containerFactory) throws IOException, ParseException {
reset(in);
LinkedList statusStack = new LinkedList();
LinkedList valueStack = new LinkedList();
try{
do{
nextToken();
switch(status){
... | Create a Java method that does the following: "Parse the content of the reader.". |
Of course, here is the Java code you requested:
```java
public java.util.List<String> getInclude() {
if (include == null) {
include = new com.amazonaws.internal.SdkInternalList<String>();
}
return include;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the include property.". |
Of course, here is the Java code you requested:
```java
public boolean compareToBuffer(FieldList record)
{
boolean bBufferEqual = true;
this.resetPosition(); // Start at the first field
int iFieldCount = record.getFieldCount(); // Number of fields to read in
for (int iFieldSeq = C... | Create a Java method that does the following: "Compare this buffer to the record.". |
Of course, here is the Java code you requested:
```java
public static String trimTrailing(String str) {
if (str == null) {
return null;
}
int len = str.length();
for (; len > 0; len--) {
if (!Character.isWhitespace(str.charAt(len - 1))) {
break;
... | Create a Java method that does the following: "Trims trailing whitespace from the end of the string.". |
Of course, here is the Java code you requested:
```java
public static String toDashedForm(String name, int start) {
StringBuilder result = new StringBuilder();
String replaced = name.replace('_', '-');
for (int i = start; i < replaced.length(); i++) {
char ch = replaced.charAt(i);
if (Character.isUpperCase... | Create a Java method that does the following: "Converts a name in a dashed form.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean isValid(Object obj, ConstraintValidatorContext constraintContext) {
// Si l'Objet est null
if(obj == null) return acceptNullObject;
// Si l'Objet est un tableau
if(obj.getClass().isArray()) {
// Taille
i... | Create a Java method that does the following: "Method is invoked to check if the specified object is valid for this device.". |
Of course, here is the Java code you requested:
```java
public Observable<Page<MediaServiceInner>> listByResourceGroupNextAsync(final String nextPageLink) {
return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<MediaServiceInner>>, Page<MediaServic... | Create a Java method that does the following: "Gets a list of a resource by resource group.". |
Of course, here is the Java code you requested:
```java
protected void doSubGeneration(TreeLogger logger, GeneratorContext context) {
for (InjectorWritterSubGenerate delegate : Iterables.filter(this.delegates, InjectorWritterSubGenerate.class)) {
delegate.subGenerate(logger, context);
}
}
```
Hope this helps! | Create a Java method that does the following: "Sub - generation of the generated classes.". |
Of course, here is the Java code you requested:
```java
public
void setSyslogHost(final String syslogHost) {
final Writer syslogWriter;
if (syslogHost.startsWith("tcp:")) {
syslogWriter = new TCPSyslogWriter(syslogHost);
} else {
syslogWriter = new SyslogWriter(syslogHost);
}
this... | Create a Java method that does the following: "Sets the syslog host.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean createTileMatrixSetTable() {
verifyWritable();
boolean created = false;
TileMatrixSetDao dao = getTileMatrixSetDao();
try {
if (!dao.isTableExists()) {
created = tableCreator.createTileMatrixSet() > 0;
}
} catch (SQL... | Create a Java method that does the following: "Create the Tile Matrix Set table". |
Of course, here is the Java code you requested:
```java
public String getAuthorizationUri(List<Scope> scopes, String redirectUri, String state) {
return getAuthorizationUri(scopes, redirectUri, state, null, null);
}
```
Hope this helps! | Create a Java method that does the following: "Get authorization URI.". |
Of course, here is the Java code you requested:
```java
public Future<T> recover(final Function<? super Throwable, ? extends T> fn) {
return Future.of(toCompletableFuture().exceptionally((Function)fn));
}
```
Hope this helps! | Create a Java method that does the following: "Recover a new instance of the class.". |
Of course, here is the Java code you requested:
```java
public void setTableState(CmsFileExplorerSettings state) {
if (state != null) {
m_fileTable.setSortContainerPropertyId(state.getSortColumnId());
m_fileTable.setSortAscending(state.isSortAscending());
Object[] visibleCo... | Create a Java method that does the following: "Sets the table state.". |
Of course, here is the Java code you requested:
```java
public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
Files.copy(response.readEntity(InputStream.class), file.toPath());
return file;
} catch (IOException e) {
... | Create a Java method that does the following: "Download file from response". |
Of course, here is the Java code you requested:
```java
@Override
public Optional<DatenFilm> deserialize(final JsonElement aElement, final Type aType,
final JsonDeserializationContext aContext) {
try {
final Optional<JsonObject> viewer = getViewer(aElement.getAsJsonObject());
if (viewer.isPrese... | Create a Java method that does the following: "Override to do the actual deserialization.". |
Of course, here is the Java code you requested:
```java
protected Object getAllValues(BackedSession sess) {
if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames... | Create a Java method that does the following: "Get all values from the database". |
Of course, here is the Java code you requested:
```java
@Override
protected StateEpisode getStateEpisodeForState(IState state)
{
if (!(state instanceof ServerState))
return null;
ServerState sstate = (ServerState)state;
switch (sstate)
{
case WAITING_FOR_MOD... | Create a Java method that does the following: "Get the StateEpisode for the given state.". |
Of course, here is the Java code you requested:
```java
private Queue<ReadFuture> getWaitingReadFutures() {
Queue<ReadFuture> waitingReadyReadFutures =
(Queue<ReadFuture>) getAttribute(WAITING_READ_FUTURES_KEY);
if (waitingReadyReadFutures == null) {
waitingReadyReadFutures = ne... | Create a Java method that does the following: "Get the waiting read futures.". |
Of course, here is the Java code you requested:
```java
@Override
public void run() {
try {
// do the validation
m_externLinkValidator.validateLinks(m_cms);
} catch (Throwable e) {
getReport().println(e);
if (LOG.isErrorEnabled()) {
L... | Create a Java method that does the following: "Run the I18N action.". |
Of course, here is the Java code you requested:
```java
private Jws<Claims> parseOidcToken(HttpServletRequest req) {
final String authHeader = req.getHeader(HttpHeaders.AUTHORIZATION);
if (StringUtils.isBlank(authHeader)
|| !authHeader.startsWith(Headers.BEARER_TOKEN_PREFIX)) {
... | Create a Java method that does the following: "Parses the OIDC token from the request.". |
Of course, here is the Java code you requested:
```java
public void setAddIamRoles(java.util.Collection<String> addIamRoles) {
if (addIamRoles == null) {
this.addIamRoles = null;
return;
}
this.addIamRoles = new com.amazonaws.internal.SdkInternalList<String>(addIamRoles... | Create a Java method that does the following: "Sets the value of the addIamRoles property.". |
Of course, here is the Java code you requested:
```java
public void setProductName(java.util.Collection<StringFilter> productName) {
if (productName == null) {
this.productName = null;
return;
}
this.productName = new java.util.ArrayList<StringFilter>(productName);
... | Create a Java method that does the following: "Sets the value of the productName property.". |
Of course, here is the Java code you requested:
```java
public static void sanityCheck(List<Protocol> protocols) throws Exception {
// check for unique IDs
Set<Short> ids=new HashSet<>();
for(Protocol protocol: protocols) {
short id=protocol.getId();
if(id > 0 && !ids.a... | Create a Java method that does the following: "Sanity check for protocol list.". |
Of course, here is the Java code you requested:
```java
public static final FastBuildTree throwableToTree(String id, String nodeID, Throwable error) {
FastBuildTree msg = new FastBuildTree(7);
msg.putUnsafe("id", id);
msg.putUnsafe("ver", PROTOCOL_VERSION);
msg.putUnsafe("sender", nodeID);
msg.putUnsa... | Create a Java method that does the following: "Converts a Throwable to a FastBuildTree.". |
Of course, here is the Java code you requested:
```java
protected <T> String resolveApitraryEntity(T entity) {
String entityName = ClassUtil.getClassAnnotationValue(entity.getClass(), Entity.class, "value", String.class);
if (entityName == null || entityName.isEmpty()) {
entityName = StringUtil.toVerb(entity.ge... | Create a Java method that does the following: "Resolves the name of the entity that is an apitrary.". |
Of course, here is the Java code you requested:
```java
private AnimatorListener createHideAnimationListener(@NonNull final View animatedView,
@Nullable final AnimatorListener listener) {
return new AnimatorListener() {
@Override
... | Create a Java method that does the following: "Creates an animation listener which allows to hide the animated view when an animation is triggered.". |
Of course, here is the Java code you requested:
```java
public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(
String parent, String filter) {
GetVulnerabilityOccurrencesSummaryRequest request =
GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
.setParent(p... | Create a Java method that does the following: "Get the Vulnerability Occurrences Summary for a single resource.". |
Of course, here is the Java code you requested:
```java
public Jar setMapAttribute(String name, Map<String, ?> values) {
return setAttribute(name, join(values));
}
```
Hope this helps! | Create a Java method that does the following: "Sets an attribute to a map of strings.". |
Of course, here is the Java code you requested:
```java
@Override
public EClass getIfcActionRequest() {
if (ifcActionRequestEClass == null) {
ifcActionRequestEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(1);
}
return ifcActionRequestEClass;
... | Create a Java method that does the following: "Get the IfcActionRequestEClass for the ifcActionRequest.". |
Of course, here is the Java code you requested:
```java
public int read() throws IOException {
while (in != null) {
int c = in.read();
if (c != -1) {
return c;
}
nextStream();
}
return -1;
}
```
Hope this helps! | Create a Java method that does the following: "read method for a single page of content.". |
Of course, here is the Java code you requested:
```java
public Event getEventFromHtml(String html) throws IOException, ParseException, SherdogParserException {
return new EventParser(zoneId).parseFromHtml(html);
}
```
Hope this helps! | Create a Java method that does the following: "Get an event from an HTML string.". |
Of course, here is the Java code you requested:
```java
public ReportInstanceStatusRequest withReasonCodes(ReportInstanceReasonCodes... reasonCodes) {
com.amazonaws.internal.SdkInternalList<String> reasonCodesCopy = new com.amazonaws.internal.SdkInternalList<String>(reasonCodes.length);
for (ReportInst... | Create a Java method that does the following: "Sets the reason codes.". |
Of course, here is the Java code you requested:
```java
private void onWindowHit(Node node) {
admittor.record(node.key);
node.moveToTail(headWindow);
}
```
Hope this helps! | Create a Java method that does the following: "On window hit.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.GPARC__XPOS:
return XPOS_EDEFAULT == null ? xpos != null : !XPOS_EDEFAULT.equals(xpos);
case AfplibPackage.GPARC__YPOS:
return YPOS_EDEFAULT == null ? ypos !... | Create a Java method that does the following: "Override the eIsSet method for the feature ID". |
Of course, here is the Java code you requested:
```java
public void load() throws IOException, JAXBException
{
Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
content = (JAXBElement<T>) unmarshaller.unmarshal(url);
}
```
Hope this helps! | Create a Java method that does the following: "Load the data from the URL.". |
Of course, here is the Java code you requested:
```java
public void dropRole(String name) {
if (!isRole(name)) {
throw Error.error(ErrorCode.X_0P000, name);
}
if (GranteeManager.isReserved(name)) {
throw Error.error(ErrorCode.X_42507);
}
removeGrantee(... | Create a Java method that does the following: "Drops a role from the application.". |
Of course, here is the Java code you requested:
```java
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SimpleAntlrPackage.RULE_ELEMENT__GUARD:
return getGuard();
case SimpleAntlrPackage.RULE_ELEMENT__GUARDED:
return get... | Create a Java method that does the following: "Override eGet to return the value of the CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA - CRA". |
Of course, here is the Java code you requested:
```java
public final EObject entryRuleXNullLiteral() throws RecognitionException {
EObject current = null;
EObject iv_ruleXNullLiteral = null;
try {
// InternalSARL.g:15207:53: (iv_ruleXNullLiteral= ruleXNullLiteral EOF )
... | Create a Java method that does the following: "Use this method to look for a ruleXNullLiteral in the input.". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "mfenced")
public JAXBElement<MfencedType> createMfenced(MfencedType value) {
return new JAXBElement<MfencedType>(_Mfenced_QNAME, MfencedType.class, null, value);
}
```
Hope... | Create a Java method that does the following: "Create an instance of MfencedType". |
Of course, here is the Java code you requested:
```java
public void marshall(BatchLookupPolicy batchLookupPolicy, ProtocolMarshaller protocolMarshaller) {
if (batchLookupPolicy == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given BatchLookupPolicy object to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
public List<TaskMonitor> getTaskMonitors(RuntimeContext context) {
return getTaskMonitors().stream().filter(monitor ->
monitor.isEnabled(context)
).collect(Collectors.toList());
}
```
Hope this helps! | Create a Java method that does the following: "Get all task monitors that are enabled for the given runtime context.". |
Of course, here is the Java code you requested:
```java
public static String getName(final Method m) {
StringBuilder ret = new StringBuilder();
ret.append(getName(m.getReturnType())).append(' ');
ret.append(m.getName()).append('(');
Class<?>[] parameterTypes = m.getParameterTypes();
for (int i = 0; i < param... | Create a Java method that does the following: "Get the name of the method.". |
Of course, here is the Java code you requested:
```java
public PublicEndpoint withMetrics(java.util.Map<String, Double> metrics) {
setMetrics(metrics);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the metrics for the resource.". |
Of course, here is the Java code you requested:
```java
@Override
public Set<KamNode> getAdjacentNodes(KamNode kamNode,
EdgeFilter edgeFilter, NodeFilter nodeFilter) {
return getAdjacentNodes(kamNode, EdgeDirectionType.BOTH, edgeFilter,
nodeFilter);
}
```
Hope this helps! | Create a Java method that does the following: "Get the nodes which are adjacent to the kamNode.". |
Of course, here is the Java code you requested:
```java
private String getBestPattern(String skeleton, DateTimeMatcher skipMatcher, int options) {
EnumSet<DTPGflags> flags = EnumSet.noneOf(DTPGflags.class);
// Replace hour metacharacters 'j', 'C', and 'J', set flags as necessary
StringBuilder s... | Create a Java method that does the following: "Get the best pattern for the given skeleton.". |
Of course, here is the Java code you requested:
```java
public int getXForBeat(int beat) {
BeatGrid grid = beatGrid.get();
if (grid != null) {
return millisecondsToX(grid.getTimeWithinTrack(beat));
}
return 0;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the x value for a particular beat.". |
Of course, here is the Java code you requested:
```java
@Indexable(type = IndexableType.REINDEX)
@Override
public CommerceCurrency updateCommerceCurrency(
CommerceCurrency commerceCurrency) {
return commerceCurrencyPersistence.update(commerceCurrency);
}
```
Hope this helps! | Create a Java method that does the following: "Updates the commerce currency in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.". |
Of course, here is the Java code you requested:
```java
@Override
public void handleMessage(final Message message) throws Fault {
OutputStream os = message.getContent(OutputStream.class);
if (null == os) {
String encoding = (String) message.get(Message.ENCODING);
if (encodi... | Create a Java method that does the following: "Override the handling of the message.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("WeakerAccess")
@UiThread
public boolean popCurrentController() {
ThreadUtils.ensureMainThread();
RouterTransaction transaction = backstack.peek();
if (transaction == null) {
throw new IllegalStateExc... | Create a Java method that does the following: "Pop the current controller from the backstack.". |
Of course, here is the Java code you requested:
```java
private void calculateIndexGroupByInfo(IndexScanPlanNode root,
IndexGroupByInfo gbInfo) {
String fromTableAlias = root.getTargetTableAlias();
assert(fromTableAlias != null);
Index index = root.getCatalogIndex();
if ( !... | Create a Java method that does the following: "Calculate the index groupBy info.". |
Of course, here is the Java code you requested:
```java
public void setFailedSet(java.util.Collection<EventDetailsErrorItem> failedSet) {
if (failedSet == null) {
this.failedSet = null;
return;
}
this.failedSet = new java.util.ArrayList<EventDetailsErrorItem>(failedSet)... | Create a Java method that does the following: "Sets the value of the failedSet property.". |
Of course, here is the Java code you requested:
```java
public int hash(JimfsPath path) {
int hash = 31;
hash = 31 * hash + getFileSystem().hashCode();
final Name root = path.root();
final ImmutableList<Name> names = path.names();
if (equalityUsesCanonicalForm) {
// use hash codes of names ... | Create a Java method that does the following: "Returns the hash code of the given path.". |
Of course, here is the Java code you requested:
```java
public static EightyPath toRealPath( Path path ) {
if( !( path instanceof EightyPath ) ) {
throw new IllegalArgumentException( path + " should be EightyPath" );
}
EightyPath eightyPath = (EightyPath) path;
if ( eighty... | Create a Java method that does the following: "Converts a path to a real path.". |
Of course, here is the Java code you requested:
```java
@Override
public EClass getIfcValveType() {
if (ifcValveTypeEClass == null) {
ifcValveTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(748);
}
return ifcValveTypeEClass;
}
```
Hope th... | Create a Java method that does the following: "Get the IfcValveType class.". |
Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setErschlAttr(ErschliessungUmfang.ErschlAttr value) {
this.erschlAttr = value;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value of the erschlAttr property.". |
Of course, here is the Java code you requested:
```java
public void setComparator(int index, Comparator<T> comparator) throws IndexOutOfBoundsException {
setComparator(index, comparator, false);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the comparator at the given index.". |
Of course, here is the Java code you requested:
```java
private void diffClique(float[] weights, int p) {
for (int t = 0; t < orders.length; t++) {
if (data[p][t] == -1)
continue;
if (orders[t] == 0) {
if (golds[p] != preds[p]) {
int ts = data[p][t] + golds[p];
int ps = data[p][t] + ... | Create a Java method that does the following: "Handles the differences between the gold and pred values of the two data sets.". |
Of course, here is the Java code you requested:
```java
public JSONObject accumulate(String name, Object value) throws JSONException {
Object current = this.nameValuePairs.get(checkName(name));
if (current == null) {
return put(name, value);
}
// check in accumulate, since array.put(Object) doesn't do any ... | Create a Java method that does the following: "Accumulate a name - value pair into this object.". |
Of course, here is the Java code you requested:
```java
public boolean hasNext() {
while (next == null && iterator.hasNext()) {
E element = iterator.next();
if (filter.accept(element)) {
next = element;
break;
}
}
r... | Create a Java method that does the following: "Returns true if the iterator has more elements.". |
Of course, here is the Java code you requested:
```java
public void createTransitions( GraphImpl graph, Tree<Row> pointer ){
Row row = pointer.getContent();
Element mainToken = row.getMainElement();
Type type = mainToken.getType();
Tree<Row> next;
switch( type ) {
ca... | Create a Java method that does the following: "Create the transitions for a node.". |
Of course, here is the Java code you requested:
```java
public static void stopBackgroundLoading() {
Enumeration e = cacheLoadsInProgress.elements();
while ( e.hasMoreElements() ) {
((SourcePicture) e.nextElement()).stopLoading();
}
}
```
Hope this helps! | Create a Java method that does the following: "Stop loading all the cache images.". |
Of course, here is the Java code you requested:
```java
public void getReferenceTableTexts(TableCandidate tc,
ArrayList<ArrayList<TextPiece>> linesByPage) {
/*
* Gets the table caption beginning part, e.g., "Table 4"
*/
String thisCaption = tc.getCaption().replace(" ", "");
char lastCharInThisKwd = t... | Create a Java method that does the following: "Gets the reference table texts.". |
Of course, here is the Java code you requested:
```java
public Map<String, String> getAliasPaths() {
Map<String, String> paths = new HashMap<String, String>();
for (AliasControls controls : m_aliasControls.values()) {
paths.put(controls.getId(), controls.getAlias().getSitePath());
... | Create a Java method that does the following: "Get a map of alias paths to site paths for all alias controls.". |
Of course, here is the Java code you requested:
```java
public static void toggleSoftInput(final View textView) {
try {
final InputMethodManager imm = (InputMethodManager)textView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInputFromWindow(textView.getWindowToken(), 0, 0)... | Create a Java method that does the following: "Toggles the soft input of the given textView.". |
Of course, here is the Java code you requested:
```java
public <T> void add(List<T> list, int index, T value) {
list.add(index, value);
}
```
Hope this helps! | Create a Java method that does the following: "Add a value to the list.". |
Of course, here is the Java code you requested:
```java
protected String getSingleStringAttribute(MBeanServerExecutor pMBeanServerExecutor, String pMBeanName, String pAttribute) {
Set<ObjectName> serverMBeanNames = searchMBeans(pMBeanServerExecutor, pMBeanName);
if (serverMBeanNames.size() == 0) {
... | Create a Java method that does the following: "Get single string attribute value.". |
Of course, here is the Java code you requested:
```java
private void initialize(String authority, String path) {
this.authority = authority;
this.path = path;
validFlagOn();
}
```
Hope this helps! | Create a Java method that does the following: "Initialize the class.". |
Of course, here is the Java code you requested:
```java
private void fillOrder(JsonObject summary) {
if (summary != null) {
order = summary.getString("order", order);
}
if (order == null && openGraphCommentOrder != null) {
order = openGraphCommentOrder;
}
}
```
Hope this helps! | Create a Java method that does the following: "Fill the order field from the json object.". |
Of course, here is the Java code you requested:
```java
public DynamoDBQueryExpression<T> withRangeKeyCondition(String rangeKeyAttributeName, Condition rangeKeyCondition) {
if ( rangeKeyConditions == null )
rangeKeyConditions = new HashMap<String, Condition>();
rangeKeyConditions.put(rangeK... | Create a Java method that does the following: "Add a range key condition to the query expression.". |
Of course, here is the Java code you requested:
```java
private static boolean shouldSkipImportTreeFix(DiagnosticPosition position, Fix f) {
if (position.getTree() != null && position.getTree().getKind() != Kind.IMPORT) {
return false;
}
return !f.getImportsToAdd().isEmpty() || !f.getImportsToRemove... | Create a Java method that does the following: "Returns true if the fix should be skipped for an import tree.". |
Of course, here is the Java code you requested:
```java
public Rule AbcTune() {
return Sequence(
AbcHeader(),
AbcMusic(),
FirstOf(WhiteLines(), Eols(), EOI).suppressNode()
).label(AbcTune);
}
```
Hope this helps! | Create a Java method that does the following: "creates a Sequence with a single SEGMENT ABBREVIATION". |
Of course, here is the Java code you requested:
```java
@RequestMapping(value = "create", method = RequestMethod.GET)
public Form getCreationForm() {
return Form.create()
.with(Form.defaultNameField())
.with(Text.of("fullName").length(100).label("Full name").help("Display na... | Create a Java method that does the following: "Returns a form that displays the creation of a new Crafter App App". |
Of course, here is the Java code you requested:
```java
public List<BookmarkedConference> getBookmarkedConferences() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
retrieveBookmarks();
return Collections.unmodifiableList(bookmarks.getBookmarkedConferences(... | Create a Java method that does the following: "Returns a list of bookmarked conferences.". |
Of course, here is the Java code you requested:
```java
public String convertIfcSurfaceFeatureTypeEnumToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
```
Hope this helps! | Create a Java method that does the following: "This method is called to convert a convertIfcSurfaceFeatureTypeEnum to a String.". |
Of course, here is the Java code you requested:
```java
public void connect() throws IOException {
SmbTransport trans;
SmbSession ssn;
UniAddress addr;
if( isConnected() ) {
return;
}
getUncPath0();
getFirstAddress();
for ( ;; ) {... | Create a Java method that does the following: "Connects to the server and returns the information of the user.". |
Of course, here is the Java code you requested:
```java
@Override
public ListTemplatesResult listTemplates(ListTemplatesRequest request) {
request = beforeClientExecution(request);
return executeListTemplates(request);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a list of templates that are contained in a CA.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <T extends Config> T remove(Object key) {
return (T) CACHE.remove(key);
}
```
Hope this helps! | Create a Java method that does the following: "Removes the object from the cache.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("WeakerAccess")
public SnackbarBuilder actionDismissCallback(final SnackbarActionDismissCallback callback) {
callbacks.add(new SnackbarCallback() {
public void onSnackbarActionPressed(Snackbar snackbar) {
callback.onSnackbarA... | Create a Java method that does the following: "Add an action dismiss callback to the Snackbar.". |
Of course, here is the Java code you requested:
```java
public boolean hasParams() {
return !cookieParams.isEmpty() || !urlParams.isEmpty() || !formParams.isEmpty() || !headerParams.isEmpty() || !multipartParams.isEmpty();
}
```
Hope this helps! | Create a Java method that does the following: "Returns true if the request has any parameters.". |
Of course, here is the Java code you requested:
```java
public EmbedBuilder clear()
{
description.setLength(0);
fields.clear();
url = null;
title = null;
timestamp = null;
color = Role.DEFAULT_COLOR_RAW;
thumbnail = null;
author = null;
footer... | Create a Java method that does the following: "Clear the content of the CRS SECTYPE.". |
Of course, here is the Java code you requested:
```java
public static ApiConfiguration fromPropertiesWithOverrides(final String apiUrl, final String apiKey, final String application, final String environment, final String allowComDotStackify) {
ApiConfiguration props = ApiConfigurations.fromProperties();
String m... | Create a Java method that does the following: "Creates an ApiConfiguration object from properties.". |
Of course, here is the Java code you requested:
```java
public static String replace(String s, Map<String, Object> map) {
StringBuilder ret = new StringBuilder((int) (s.length() * 1.5));
int cursor = 0;
for (int start, end; (start = s.indexOf("${", cursor)) != -1 && (end = s.indexOf("}", sta... | Create a Java method that does the following: "Replaces all the occurrences of the specified tokens in the specified string with the corresponding value from the specified map.". |
Of course, here is the Java code you requested:
```java
@Trivial
public static String formatMethod(Method m) {
if (m == null) {
return "null";
}
StringBuilder sb = new StringBuilder();
sb.append(m.getDeclaringClass().getName());
sb.append(".");
sb.ap... | Create a Java method that does the following: "Format a method to be used in the IDEA language.". |
Of course, here is the Java code you requested:
```java
public static <R extends Resource<?>, U extends PaginatedResponse<R>> Flux<R> getResources(U response) {
return Flux.fromIterable(response.getResources());
}
```
Hope this helps! | Create a Java method that does the following: "Gets resources from a PaginatedResponse.". |
Of course, here is the Java code you requested:
```java
static <T> InternalFactory<? extends T> scope(
Key<T> key,
InjectorImpl injector,
InternalFactory<? extends T> creator,
Object source,
Scoping scoping) {
if (scoping.isNoScope()) {
return creator;
}
Scope scope = ... | Create a Java method that does the following: "Scope a single object.". |
Of course, here is the Java code you requested:
```java
public static String getPackage(Proto proto) {
DynamicMessage.Value javaPackage = proto.getOptions().get(OPTION_JAVA_PACKAGE);
if (javaPackage != null) {
return javaPackage.getString();
}
return proto.getPackage().getVa... | Create a Java method that does the following: "Gets the package name from the proto.". |
Of course, here is the Java code you requested:
```java
public com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResultOrBuilder
getKMapEstimationResultOrBuilder() {
if (resultCase_ == 7) {
return (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult) result_;
... | Create a Java method that does the following: "Gets the value of the kMapEstimationResult property.". |
Of course, here is the Java code you requested:
```java
public String getScopes(HttpRequest req) throws OAuthException {
QueryStringDecoder dec = new QueryStringDecoder(req.uri());
Map<String, List<String>> queryParams = dec.parameters();
if (queryParams.containsKey("client_id")) {
... | Create a Java method that does the following: "Get the scopes from the request.". |
Of course, here is the Java code you requested:
```java
protected Property getProperty(String name) {
if (!properties.containsKey(name)) {
properties.put(name, new Property(name));
}
return properties.get(name);
}
```
Hope this helps! | Create a Java method that does the following: "Get a property by name.". |
Of course, here is the Java code you requested:
```java
public static char[] unWrap(Character... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new char[0];
}
char[] array = new char[length];
for (int i = 0; i < length; i++) {
... | Create a Java method that does the following: "Creates an array of characters that are not wrapped in a Character object.". |
Of course, here is the Java code you requested:
```java
public static TimeOfDay fromCalendarFields(Calendar calendar) {
if (calendar == null) {
throw new IllegalArgumentException("The calendar must not be null");
}
return new TimeOfDay(
calendar.get(Calendar.HOUR_OF_DAY)... | Create a Java method that does the following: "Gets the TimeOfDay from the calendar.". |
Of course, here is the Java code you requested:
```java
public static BitWriter writerTo(int[] ints, long size) {
if (ints == null) throw new IllegalArgumentException("null ints");
if (size < 0) throw new IllegalArgumentException("negative size");
long maxSize = ((long) ints.length) << 5;
if (size > maxSize) t... | Create a Java method that does the following: "Create a BitWriter to write ints to.". |
Of course, here is the Java code you requested:
```java
private static InetAddress[] getAllLocalInetAddresses(final Log log)
throws SocketException {
final List addresses = new ArrayList();
// get the network adapters
final Enumeration netInterfaces = NetworkInterface.getNetworkI... | Create a Java method that does the following: "Get all the local InetAddress objects.". |
Of course, here is the Java code you requested:
```java
public int getRunLevel(int run)
{
verifyValidParaOrLine();
BidiLine.getRuns(this);
verifyRange(run, 0, runCount);
getLogicalToVisualRunsMap();
return runs[logicalToVisualRunsMap[run]].level;
}
```
Hope this helps! | Create a Java method that does the following: "Get the level of a given run.". |
Of course, here is the Java code you requested:
```java
public JSPStrBuffer replace(int start, int end, String string) {
sb.replace(start, end, string);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Replaces the characters in this buffer with the given string.". |
Of course, here is the Java code you requested:
```java
public BinaryString toLowerCase() {
if (javaObject != null) {
return toLowerCaseSlow();
}
if (sizeInBytes == 0) {
return EMPTY_UTF8;
}
int size = segments[0].size();
SegmentAndOffset segmentAndOffset = startSegmentAndOffset(size);
byte[] bytes... | Create a Java method that does the following: "Returns a new string with the lower case of this string.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.