code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java @Override public CommerceTaxFixedRate[] findByCPTaxCategoryId_PrevAndNext( long commerceTaxFixedRateId, long CPTaxCategoryId, OrderByComparator<CommerceTaxFixedRate> orderByComparator) throws NoSuchTaxFixedRateException { CommerceTaxFixedRate commerceTax...
Create a Java method that does the following: "Returns the commerce tax fixed rates before and after the current CPTaxCategoryId.".
Of course, here is the Java code you requested: ```java public static LogEntry fromLogRecord(LogRecord record){ Level level; long when = 0; String message = ""; when = record.getMillis(); message = (record.getMessage()==null?"":record.getMessage()); level = record.getLevel(); return new LogEntr...
Create a Java method that does the following: "Creates a LogEntry object from a log record.".
Of course, here is the Java code you requested: ```java public TargetsResponse getPersonalFavorites(BigDecimal limit) throws ApiException { ApiResponse<TargetsResponse> resp = getPersonalFavoritesWithHttpInfo(limit); return resp.getData(); } ``` Hope this helps!
Create a Java method that does the following: "Get Personal Favorites Returns Personal Favorites for the current user".
Of course, here is the Java code you requested: ```java @Override public boolean supports(TherianContext context, Copy<? extends Object, ? extends Map> copy) { if (!super.supports(context, copy)) { return false; } final Type targetKeyType = getKeyType(copy.getTargetPosition...
Create a Java method that does the following: "Override to check if the given copy is a .".
Of course, here is the Java code you requested: ```java private File getKeenCacheDirectory() throws IOException { File file = new File(root, "keen"); if (!file.exists()) { boolean dirMade = file.mkdir(); if (!dirMade) { throw new IOException("Could not make keen ...
Create a Java method that does the following: "Gets the keen cache directory.".
Of course, here is the Java code you requested: ```java public void value2x2( double a11 , double a12, double a21 , double a22 ) { // apply a rotators such that th a11 and a22 elements are the same double c,s; if( a12 + a21 == 0 ) { // is this pointless since c = s = 1.0 / Math...
Create a Java method that does the following: "Compute the 2x2 rotation of the tc_lang file.".
Of course, here is the Java code you requested: ```java protected boolean checkImmutable(String resourceName) { boolean resourceImmutable = false; if (getImmutableResources().contains(resourceName)) { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get()...
Create a Java method that does the following: "Checks if the resource is immutable.".
Of course, here is the Java code you requested: ```java private JsonWriter open(int empty, String openBracket) throws IOException { beforeValue(); push(empty); out.write(openBracket); return this; } ``` Hope this helps!
Create a Java method that does the following: "open a bracket".
Of course, here is the Java code you requested: ```java @When("^I de-select every item on the element on index '(\\d+?)'$") public void elementDeSelect(Integer index) { Select sel = null; sel = new Select(commonspec.getPreviousWebElements().getPreviousWebElements().get(index)); if (sel.isM...
Create a Java method that does the following: "Element de - select every item on the element on the index".
Of course, here is the Java code you requested: ```java protected void customizeUnmarshaller(Unmarshaller unmarshaller) { unmarshaller.setValidation(this.validating); unmarshaller.setWhitespacePreserve(this.whitespacePreserve); unmarshaller.setIgnoreExtraAttributes(this.ignoreExtraAttributes); unmarshaller.set...
Create a Java method that does the following: "Customize the unmarshaller.".
Of course, here is the Java code you requested: ```java public boolean confirmUninstallChanges(Component parent, UninstallationResult result, Set<AddOn> addOnsBeingDownloaded) { Set<AddOn> forcedUninstallations = new HashSet<>(result.getUninstallations()); forcedUninstallations.removeAll(result.getSel...
Create a Java method that does the following: "Confirm uninstall changes.".
Of course, here is the Java code you requested: ```java public void initialize( Supplier<DataSource<Bitmap>> dataSourceSupplier, String id, Object callerContext) { super.initialize(id, callerContext); init(dataSourceSupplier); } ``` Hope this helps!
Create a Java method that does the following: "Initializes the sequence of blocks.".
Of course, here is the Java code you requested: ```java public static TableModel[] db2Models(Connection con, Dialect dialect) {// NOSONAR List<TableModel> tableModels = new ArrayList<TableModel>(); SQLException sqlException = null; ResultSet rs = null; PreparedStatement pst = null; try { DatabaseMetaData...
Create a Java method that does the following: "Convert a database connection to a list of TableModels".
Of course, here is the Java code you requested: ```java public void forAllProcedures(String template, Properties attributes) throws XDocletException { for (Iterator it = _curClassDef.getProcedures(); it.hasNext(); ) { _curProcedureDef = (ProcedureDef)it.next(); generate...
Create a Java method that does the following: "Processes all procedures of the current class.".
Of course, here is the Java code you requested: ```java public boolean setKerning(int char1, int char2, int kern) { int metrics[] = getMetricsTT(char1); if (metrics == null) return false; int c1 = metrics[0]; metrics = getMetricsTT(char2); if (metrics == null) ...
Create a Java method that does the following: "Set the kern value for two characters.".
Of course, here is the Java code you requested: ```java protected void interceptIntDataType(Op op) { // FIXME: Remove this method, after we'll add support for <int> dtype operations if (op.x() != null && op.x().data().dataType() == DataBuffer.Type.INT) throw new ND4JIllegalStateException( ...
Create a Java method that does the following: "Intercept the int data type of the given operation.".
Of course, here is the Java code you requested: ```java public void append(final LoggingEvent event) { boolean isBufferSpaceAvailable = (batcher.isSpaceAvailable() && (logSummaryMap .size() == 0)); boolean isBufferPutSuccessful = false; LocationInfo locationInfo = null; ...
Create a Java method that does the following: "Append an event to the buffer.".
Of course, here is the Java code you requested: ```java public Options putFloat(String key, IModel<Float> value) { putOption(key, new FloatOption(value)); return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a Float option to the options.".
Of course, here is the Java code you requested: ```java protected final Stack<Long> addNewText(final Stack<Long> paramLeftSiblingKeyStack, final String paramText) throws TTException { assert paramLeftSiblingKeyStack != null; final String text = paramText; long key; final ByteBuf...
Create a Java method that does the following: "Add a new text to the leftSibling key stack.".
Of course, here is the Java code you requested: ```java private void initializeDerivatives(T input) { // reshape derivatives if the input image has changed size if (detector.getRequiresGradient() || detector.getRequiresHessian()) { derivX.reshape(input.width, input.height); derivY.reshape(input.width, input....
Create a Java method that does the following: "Initializes the derivative images.".
Of course, here is the Java code you requested: ```java public void printAnalBlock() { StringBuilder buf = new StringBuilder("GRID ANALYSIS BLOCK:"); if (analBlock != null) { buf.append(analBlock.toString()); } else { buf.append("\n\tUNKNOWN ANALYSIS TYPE"); } System.out.println(buf.toS...
Create a Java method that does the following: "Print the ANGLE BLOCK".
Of course, here is the Java code you requested: ```java public void onTCBegin(TCBeginIndication tcBeginIndication) { ApplicationContextName acn = tcBeginIndication.getApplicationContextName(); Component[] comps = tcBeginIndication.getComponents(); // ETS 300 974 Section 12.1.3 // On r...
Create a Java method that does the following: "This method is called when a TC - BEGIN indication is received from the TC - BEGIN indication.".
Of course, here is the Java code you requested: ```java public static BsonDocument copyOfDocument(final BsonDocument document) { final BsonDocument newDocument = new BsonDocument(); for (final Map.Entry<String, BsonValue> kv : document.entrySet()) { newDocument.put(kv.getKey(), kv.getValue()); } ...
Create a Java method that does the following: "Creates a copy of the given document.".
Of course, here is the Java code you requested: ```java protected void loadRulesFromProperties(Properties p) { for (String key : p.stringPropertyNames()) { Matcher m = RE_TAG_ATTR_TYPE.matcher(key); if (m.matches()) { String tagName = m.group(1); String testAttrName = m.group(2); String testAttrVal...
Create a Java method that does the following: "Load rules from properties.".
Of course, here is the Java code you requested: ```java @Nullable public static String [] getRectValues (@Nullable final String sCSSValue) { String [] ret = null; final String sRealValue = StringHelper.trim (sCSSValue); if (StringHelper.hasText (sRealValue)) { ret = RegExHelper.getAllMatching...
Create a Java method that does the following: "Get all the value of the CTCTYPE attribute.".
Of course, here is the Java code you requested: ```java public void doesNotContainKey(@NullableDecl Object key) { check("keySet()").that(actual().keySet()).doesNotContain(key); } ``` Hope this helps!
Create a Java method that does the following: "Fails if the set does not contain the given key.".
Of course, here is the Java code you requested: ```java public String getTagText(final File xmlFile, final String fileEncoding, final String tagName) throws ParserConfigurationException, SAXException, IOException { return this.getTagText( fileUtil.getFileContentsAsString(xmlFile, fileEncoding), tagNam...
Create a Java method that does the following: "Get the text of the tag with the specified name from the specified XML file.".
Of course, here is the Java code you requested: ```java private static final ArrayList<String> convertStringToArrayList(String value) { if (value != null && value.length() > 0) { ArrayList<String> result = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(value, STRING_A...
Create a Java method that does the following: "Convert a string to an ArrayList of strings.".
Of course, here is the Java code you requested: ```java public void initializeCurrency() { if (!currencyInitialized) { sendConsoleMessage(Level.INFO, getLanguageManager().getString("loading_currency_manager")); currencyManager = new CurrencyManager(); currencyInitialized = t...
Create a Java method that does the following: "Initialize the currency.".
Of course, here is the Java code you requested: ```java @UsedByGeneratedCode public __DynamicallyDispatchable determineDispatcher(Object instance, String nameAndDescriptor) { if (nameAndDescriptor.startsWith("<init>")) { // its a ctor, no dynamic lookup required if (!hasBeenReloaded()) { // TODO evaluate...
Create a Java method that does the following: "Determine a dispatcher for a given instance.".
Of course, here is the Java code you requested: ```java public static Expression arrayAppend(String expression, Expression value) { return arrayAppend(x(expression), value); } ``` Hope this helps!
Create a Java method that does the following: "Returned expression results in an array containing the given value.".
Of course, here is the Java code you requested: ```java public long getDifferenceAsLong(ReadableInstant instant) { if (instant == null) { return getField().getDifferenceAsLong(getMillis(), DateTimeUtils.currentTimeMillis()); } return getField().getDifferenceAsLong(getMillis(), insta...
Create a Java method that does the following: "Gets the difference in milliseconds as long.".
Of course, here is the Java code you requested: ```java private android.view.MenuItem addInternal(int group, int id, int categoryOrder, CharSequence title) { final int ordering = getOrdering(categoryOrder); final MenuItem item = createNewMenuItem(group, id, categoryOrder, ordering, title, ...
Create a Java method that does the following: "Add a new item to the list.".
Of course, here is the Java code you requested: ```java public static <T extends Serializable> byte[] serializeIntoBytes(T obj) throws IOException { try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(obj); oos.fl...
Create a Java method that does the following: "Serialize an object into a byte array.".
Of course, here is the Java code you requested: ```java static void offerLastTemporaryDirectBuffer(ByteBuffer buf) { assert buf != null; BufferCache cache = bufferCache.get(); if (!cache.offerLast(buf)) { // cache is full free(buf); } } ``` Hope this helps!
Create a Java method that does the following: "Offer the last temporary buffer to the cache.".
Of course, here is the Java code you requested: ```java public EnvironmentConfig setEnvMonitorTxnsExpirationTimeout(final int timeout) { if (timeout != 0 && timeout < 1000) { throw new InvalidSettingException("Transaction timeout should be greater than a second"); } setSetting(ENV_M...
Create a Java method that does the following: "Sets the timeout for the transaction monitor to expire.".
Of course, here is the Java code you requested: ```java public static String getPackageResource(Class<?> type, String resourceName) { StringBuilder builder = new StringBuilder(); builder.append(type.getPackage().getName().replace('.', '/')); if(resourceName.charAt(0) != '/') { builder.append('...
Create a Java method that does the following: "Gets the package resource name.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.ibm.com/websphere/wim", name = "kerberosId") public JAXBElement<String> createKerberosId(String value) { return new JAXBElement<String>(_KerberosId_QNAME, String.class, null, value); } ``` Hope this helps!
Create a Java method that does the following: "Create an instance of the KerberosId JAXBElement.".
Of course, here is the Java code you requested: ```java public IfcControllerTypeEnum createIfcControllerTypeEnumFromString(EDataType eDataType, String initialValue) { IfcControllerTypeEnum result = IfcControllerTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The val...
Create a Java method that does the following: "Returns the IfcControllerTypeEnum object that corresponds to the given initial value.".
Of course, here is the Java code you requested: ```java public boolean orderByHashParameters(List<OrderByElement> orderByElements) { if (orderByElements == null) { return false; } for (OrderByElement orderByElement : orderByElements) { if (orderByElement.toString().conta...
Create a Java method that does the following: "Method orderByHashParameters.".
Of course, here is the Java code you requested: ```java @Override public void backward() { modInX.getOutputAdj().elemAdd(yAdj); modInW.getOutputAdj().elemSubtract(yAdj); } ``` Hope this helps!
Create a Java method that does the following: "Backward implementation of the backward operation.".
Of course, here is the Java code you requested: ```java @Deprecated public String readLine() throws IOException, IllegalStateException { LOG.trace("enter HttpConnection.readLine()"); assertOpen(); return HttpParser.readLine(inputStream); } ``` Hope this helps!
Create a Java method that does the following: "Read a line from the input stream.".
Of course, here is the Java code you requested: ```java @Override public String validate(String proposedValue) throws IllegalArgumentException { if (proposedValue.isEmpty()) { return proposedValue; } return super.validate(proposedValue); } ``` Hope this helps!
Create a Java method that does the following: "Override validate to return the proposed value.".
Of course, here is the Java code you requested: ```java @Nonnull public static LByteIntConsumer byteIntConsumerFrom(Consumer<LByteIntConsumerBuilder> buildingFunction) { LByteIntConsumerBuilder builder = new LByteIntConsumerBuilder(); buildingFunction.accept(builder); return builder.build(); } ``` Hope this h...
Create a Java method that does the following: "Construct a byte int consumer from a consumer.".
Of course, here is the Java code you requested: ```java @Override public Application getApplication() { if (m_application != null) return m_application; if (this.getApplet() != null) if (this.getApplet() != this) return ((BaseApplet)this.getApplet()).getA...
Create a Java method that does the following: "Get the Application object.".
Of course, here is the Java code you requested: ```java public boolean removeSearchFieldMapping(CmsLuceneField field, CmsSearchFieldMapping mapping) throws CmsIllegalStateException { if (field.getMappings().size() < 2) { throw new CmsIllegalStateException( Messages.get().contai...
Create a Java method that does the following: "Removes a CmsSearchFieldMapping from a field.".
Of course, here is the Java code you requested: ```java void deleteUserIndexForClusters(int userIndex) { assert (m_clusterIndices.get(userIndex) != null); m_clusterIndices.set(userIndex, null); } ``` Hope this helps!
Create a Java method that does the following: "Delete the user index for all clusters.".
Of course, here is the Java code you requested: ```java public static BinaryRecordOutput get(DataOutput out) { BinaryRecordOutput bout = (BinaryRecordOutput) bOut.get(); bout.setDataOutput(out); return bout; } ``` Hope this helps!
Create a Java method that does the following: "Get a new record output from the given DataOutput.".
Of course, here is the Java code you requested: ```java protected void set(float[] newRange, float[] newCenter) { this.range = new float[newRange.length]; for (int i = 0; i < newRange.length; i++) { this.range[i] = newRange[i]; } for (int i = 0; i < newCenter.length; i++) { this.center[i] =...
Create a Java method that does the following: "Sets the range and center of the index.".
Of course, here is the Java code you requested: ```java public void resetFromXml(String xmlResourcePath) throws JoranException { LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(context); context...
Create a Java method that does the following: "Reset the logback from the XML file.".
Of course, here is the Java code you requested: ```java public ProviderGroup addAll(Collection<ProviderInfo> providerInfos) { if (CommonUtils.isEmpty(providerInfos)) { return this; } ConcurrentHashSet<ProviderInfo> tmp = new ConcurrentHashSet<ProviderInfo>(this.providerInfos); ...
Create a Java method that does the following: "Add all the providerInfos to this provider group.".
Of course, here is the Java code you requested: ```java public void associateHttpContext(final WebContainerContext httpContext, final Bundle bundle, final boolean allowReAsssociation) { List<String> virtualHosts = resolveVirtualHosts(bundle); for (String virtualHost : virtualHosts) { ConcurrentMap...
Create a Java method that does the following: "Associates the given http context with the given bundle.".
Of course, here is the Java code you requested: ```java @Override public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) { if (this.logicalDeleteColumn != null) { // 引入 Model类 topLevelClass.addImportedType(this.getColumnInModelTyp...
Create a Java method that does the following: "ModelExampleClassGenerated Method.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "_TimeObject", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_GML") public JAXBElement<AbstractTimeObjectType> create_TimeObject(AbstractTimeObjectType value)...
Create a Java method that does the following: "Create an instance of the _TimeObject property.".
Of course, here is the Java code you requested: ```java @Override public UpgradeElasticsearchDomainResult upgradeElasticsearchDomain(UpgradeElasticsearchDomainRequest request) { request = beforeClientExecution(request); return executeUpgradeElasticsearchDomain(request); } ``` Hope this helps!
Create a Java method that does the following: "Upgrade an Elasticsearch domain.".
Of course, here is the Java code you requested: ```java public byte[] encode() throws IllegalStateException { prepareForEncoding(); // make sure we have everything necessary to encode a proper message validateAttributePresentity(); final char dataLength = getDataLength(); byte binMsg[] = new byte[HEADER_L...
Create a Java method that does the following: "Encodes the STUN message into a byte array.".
Of course, here is the Java code you requested: ```java public void move(Path srcDirFilePath, Path dstDirFilePath) { String id = ids.getIfPresent(srcDirFilePath); if (id != null) { ids.put(dstDirFilePath, id); ids.invalidate(srcDirFilePath); } } ``` Hope this helps!
Create a Java method that does the following: "Move a file from one location to another.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("All") public static Locale findOptimumLocale(final String language, final String country, final String variant) { final boolean hasCountry = country != null && !country.isEmpty(); final boolean hasVariant = variant != null ...
Create a Java method that does the following: "Find the optimal locale.".
Of course, here is the Java code you requested: ```java public static String safeCreateUUID() { synchronized (EventProcessorHost.UUID_SYNCHRONIZER) { final UUID newUuid = UUID.randomUUID(); return newUuid.toString(); } } ``` Hope this helps!
Create a Java method that does the following: "Create a random UUID.".
Of course, here is the Java code you requested: ```java public static BufferedImage checkInputs(ImageBase src, BufferedImage dst) { if (dst != null) { if (dst.getWidth() != src.getWidth() || dst.getHeight() != src.getHeight()) { throw new IllegalArgumentException("Shapes do not match: "+ "src = ( "+src....
Create a Java method that does the following: "Check input image and output image.".
Of course, here is the Java code you requested: ```java public int estimateSizeOfUnassembledValue(byte[] frame, int offset, int indirect) { if (indirect == 0) return estimateUnassembledSize(frame, offset); else return coder.estimateUnassembledSize(frame, offset); } ``` Hope this helps!
Create a Java method that does the following: "Estimate the size of an unassembled value.".
Of course, here is the Java code you requested: ```java @Override public java.util.concurrent.Future<DeleteItemResult> deleteItemAsync(String tableName, java.util.Map<String, AttributeValue> key, com.amazonaws.handlers.AsyncHandler<DeleteItemRequest, DeleteItemResult> asyncHandler) { return de...
Create a Java method that does the following: "Simplified method form for invoking the DeleteItem operation with an AsyncHandler.".
Of course, here is the Java code you requested: ```java public final <C extends IRequestablePage> C newPage(final Class<C> pageClass) { PageFactory<C> content = getFactory(pageClass); if (content != null) { return content.createPage(new PageParameters()); } return new Defaul...
Create a Java method that does the following: "Create a new instance of a page.".
Of course, here is the Java code you requested: ```java protected OrderByElement cloneOrderByElement(OrderByElement orig, Expression expression) { OrderByElement element = new OrderByElement(); element.setAsc(orig.isAsc()); element.setAscDescPresent(orig.isAscDescPresent()); element.set...
Create a Java method that does the following: "Clone the OrderByElement.".
Of course, here is the Java code you requested: ```java public final void setGuaranteedRemoteBrowseID(long value) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setGuaranteedRemoteBrowseID", Long.valueOf(value)); getHdr2().setLongField(JsHdr2Access...
Create a Java method that does the following: "Sets the value of the GuaranteedRemoteBrowseID field in the message header.".
Of course, here is the Java code you requested: ```java public void checkInvalidLogins(String userName, String remoteAddress) throws CmsAuthentificationException { if (m_maxBadAttempts < 0) { // invalid login storage is disabled return; } String key = createStorageKey(...
Create a Java method that does the following: "Check if invalid logins are enabled.".
Of course, here is the Java code you requested: ```java @Deprecated public static String parse(ULocale locale, String text, int type, ParsePosition pos) { List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = CURRENCY_NAME_CACHE.get(locale); if (currencyTrieVec == null) { TextTrieMap<...
Create a Java method that does the following: "Parse a string of the specified type from the specified text.".
Of course, here is the Java code you requested: ```java public void unbox(final Type type) { Type t = NUMBER_TYPE; Method sig = null; switch (type.getSort()) { case Type.VOID: return; case Type.CHAR: t = CHARACTER_TYPE; sig = CHAR_VALUE; ...
Create a Java method that does the following: "Unbox a type.".
Of course, here is the Java code you requested: ```java public static List<CommerceOrder> findByBillingAddressId( long billingAddressId, int start, int end, OrderByComparator<CommerceOrder> orderByComparator) { return getPersistence() .findByBillingAddressId(billingAddressId, start, end, orderByCompara...
Create a Java method that does the following: "Returns a range of commerce orders where the billing address is found.".
Of course, here is the Java code you requested: ```java public static Result status(int status, Path content, FileMimeTypes fileMimeTypes) { return status(status).sendPath(content, fileMimeTypes); } ``` Hope this helps!
Create a Java method that does the following: "Send a file to the server with the specified status code and content.".
Of course, here is the Java code you requested: ```java public int deleteAll() throws SQLException { DeleteBuilder<Extensions, Void> db = deleteBuilder(); int deleted = db.delete(); return deleted; } ``` Hope this helps!
Create a Java method that does the following: "Delete all the records in the database.".
Of course, here is the Java code you requested: ```java private void populateStep3() { this.insertRoadmapItem(2, true, I18nLabelsLoader.REPORT_STEP_OMISSIONS, 3); OmissionTextListener textListener = new OmissionTextListener(); int y = 6; // omissions this.insertFixedTextBold(t...
Create a Java method that does the following: "Populate the step 3.".
Of course, here is the Java code you requested: ```java public static String convertCharset(String str, String sourceCharset, String destCharset) { if (StrUtil.hasBlank(str, sourceCharset, destCharset)) { return str; } return CharsetUtil.convert(str, sourceCharset, destCharset); } ``` Hope this helps...
Create a Java method that does the following: "Convert the given string to the given charset.".
Of course, here is the Java code you requested: ```java protected void setSessionCookie(HttpServerExchange exchange) { Session session = this.attachment.getSession(); if (session.isInvalid()) { Cookie cookie = new CookieImpl(this.config.getSessionCookieName()) .setSecure...
Create a Java method that does the following: "Sets the session cookie.".
Of course, here is the Java code you requested: ```java public <TEnum extends Enum<TEnum>> TEnum get(Enum<?> key, Class<TEnum> enumClass, TEnum defaultValue) { return getEnum(key, enumClass, defaultValue); } ``` Hope this helps!
Create a Java method that does the following: "Get a single enumeration from the cache.".
Of course, here is the Java code you requested: ```java public static Field[] getAllFields(Class<?> clz, boolean includeStatic) { return Arrays.stream(getAllFields(clz)) .filter(f -> includeStatic || !Modifier.isStatic(f.getModifiers())) .toArray(Field[]::new); } ``` Hope this helps!
Create a Java method that does the following: "Returns all the fields of a class including the static fields.".
Of course, here is the Java code you requested: ```java private static ResourceBundle tryBundle(String baseName, Locale locale, boolean wantBase) { I_CmsResourceBundle first = null; // The most specialized bundle. I_CmsResourceBundle last = null; // The least specialized bundle. List<String> ...
Create a Java method that does the following: "Tries to find a resource bundle with the given base name and locale.".
Of course, here is the Java code you requested: ```java public static Submission readSubmission(final File file) throws IOException { checkNotNull(file); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return readSubmission(reader); } } ``` Hope this he...
Create a Java method that does the following: "Read a single submission from a file.".
Of course, here is the Java code you requested: ```java public NodeDefinitionData[] getAllChildNodeDefinitions(final InternalQName... nodeTypeNames) { final Collection<NodeDefinitionData> defsAny = new ArrayList<NodeDefinitionData>(); final HashMap<InternalQName, NodeDefinitionData> defs = new HashMa...
Create a Java method that does the following: "Gets all child node definitions.".
Of course, here is the Java code you requested: ```java @Given("^json (.+?) matches schema (.+?)$") public void jsonMatchesSchema(String json, String schema) throws Exception { JSONObject jsonschema = new JSONObject(schema); JSONObject jsondeploy = new JSONObject(json); commonspec.matchJso...
Create a Java method that does the following: "Checks if a json matches a schema".
Of course, here is the Java code you requested: ```java public final void deletePosixAccount(ProjectName name) { DeletePosixAccountRequest request = DeletePosixAccountRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); deletePosixAccount(request); }...
Create a Java method that does the following: "Delete a single user from the NCSA POSIX account.".
Of course, here is the Java code you requested: ```java public static Optional<Timer.Context> timerContext(Optional<MetricContext> context, final String name) { return context.transform(new Function<MetricContext, Timer.Context>() { @Override public Timer.Context apply(@Nonnull MetricContext input) { ...
Create a Java method that does the following: "Converts a Optional<MetricContext > to a Timer. Context".
Of course, here is the Java code you requested: ```java public static vpathparam get(nitro_service service) throws Exception{ vpathparam obj = new vpathparam(); vpathparam[] response = (vpathparam[])obj.get_resources(service); return response[0]; } ``` Hope this helps!
Create a Java method that does the following: "Use this API to fetch all the vpathparam resources that are configured on netscaler.".
Of course, here is the Java code you requested: ```java protected void pushConfig(final ProposedBucketConfigContext ctx) { try { configStream.onNext(ctx); } catch (Exception e) { LOGGER.warn("Exception while pushing new configuration - ignoring.", e); } } ``` Hope t...
Create a Java method that does the following: "Push a new configuration to the stream.".
Of course, here is the Java code you requested: ```java @Override public Double[] getValues(GriddedTile griddedTile, byte[] imageBytes) { BufferedImage image; try { image = ImageUtils.getImage(imageBytes); } catch (IOException e) { throw new GeoPackageException( "Failed to create an image from image ...
Create a Java method that does the following: "Get the values from the bytes of the image".
Of course, here is the Java code you requested: ```java protected void restoreSystemStreams() { if (System.out == teeOut) System.setOut(systemOut.getOriginalStream()); if (System.err == teeErr) System.setErr(systemErr.getOriginalStream()); } ``` Hope this helps!
Create a Java method that does the following: "Restore the system streams.".
Of course, here is the Java code you requested: ```java public static DesignSpec fromResource(View view, int resId) { final Resources resources = view.getResources(); final DesignSpec spec = new DesignSpec(resources, view); if (resId == 0) { return spec; } final JSO...
Create a Java method that does the following: "Creates a new design spec object from a resource.".
Of course, here is the Java code you requested: ```java @CheckForSigned protected int findByte (final byte nValue, final int nPos) { for (int i = nPos; i < m_nTail; i++) if (m_aBuffer[i] == nValue) return i; return -1; } ``` Hope this helps!
Create a Java method that does the following: "Find the byte in the buffer.".
Of course, here is the Java code you requested: ```java private void endUnitOfWork(Throwable originalThrowable) throws Throwable { try { unitOfWork.end(); } catch (Throwable t) { if (originalThrowable != null) { throw originalThrowable; } else { throw t; } } } ``` ...
Create a Java method that does the following: "End the unit of work.".
Of course, here is the Java code you requested: ```java public Disk withDiskAttributeList(String... diskAttributeList) { if (this.diskAttributeList == null) { setDiskAttributeList(new com.amazonaws.internal.SdkInternalList<String>(diskAttributeList.length)); } for (String ele : disk...
Create a Java method that does the following: "Sets the value of the diskAttributeList property.".
Of course, here is the Java code you requested: ```java public Map<String, Object> getSiteProperties() { Map<String, Object> properties = super.getSiteProperties(); properties.put(BaseRegistrationScreen.SITE_TEMPLATE_CODE_PARAM, DEFAULT_SITE_TEMPLATE); properties.put(BaseRegistrati...
Create a Java method that does the following: "Override getSiteProperties to add the default site template to the result.".
Of course, here is the Java code you requested: ```java public void marshall(InviteMembersRequest inviteMembersRequest, ProtocolMarshaller protocolMarshaller) { if (inviteMembersRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "marshalls the given inviteMembersRequest to the JSON - compatible parameter object.".
Of course, here is the Java code you requested: ```java public void addValidation(Object key, Validation validation){ initMapOnce(); validations.put(key, validation); // update aggregated value passedAll = passedAll && validation.passed(); } ``` Hope this helps!
Create a Java method that does the following: "Adds a validation to the cache.".
Of course, here is the Java code you requested: ```java @Override public boolean removeFirstOccurrence(DelayedEntry entry) { DelayedEntry removedEntry = deque.pollFirst(); if (removedEntry == null) { return false; } decreaseCountIndex(entry); return true; } `...
Create a Java method that does the following: "Remove the first occurrence of the specified DelayedEntry from the deque.".
Of course, here is the Java code you requested: ```java @Override public void waitForData(long timeout, TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException { try { if (isDataAvailable()) { return; } long startTime = System.currentTime...
Create a Java method that does the following: "This method waits for the data to be available.".
Of course, here is the Java code you requested: ```java public com.google.protobuf.ByteString getUfsTypeBytes() { java.lang.Object ref = ufsType_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.la...
Create a Java method that does the following: "Gets the value of the ufsType_ field.".
Of course, here is the Java code you requested: ```java @Override public void initializeParts() { super.initializeParts(); node = new VBox(); node.getStyleClass().add("simple-radio-control"); toggleGroup = new ToggleGroup(); createRadioButtons(); } ``` Hope this helps!
Create a Java method that does the following: "Initialize the parts.".
Of course, here is the Java code you requested: ```java @Override public GetLicenseConfigurationResult getLicenseConfiguration(GetLicenseConfigurationRequest request) { request = beforeClientExecution(request); return executeGetLicenseConfiguration(request); } ``` Hope this helps!
Create a Java method that does the following: "Retrieves the license configuration for a specific language.".
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.EMO__OVLY_NAME: return OVLY_NAME_EDEFAULT == null ? ovlyName != null : !OVLY_NAME_EDEFAULT.equals(ovlyName); case AfplibPackage.EMO__TRIPLETS: return triplet...
Create a Java method that does the following: "Override the superclass method to check if the feature is set to a value.".
Of course, here is the Java code you requested: ```java public GitlabMergeRequestApprovals getMergeRequestApprovals(GitlabMergeRequest mr) throws IOException { String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(mr.getProjectId()) + GitlabMergeRequest.URL + "/" + mr.getIid() + GitlabMe...
Create a Java method that does the following: "Get a list of all the approved items for a merge request".