code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public void marshall(PutItemRequest putItemRequest, ProtocolMarshaller protocolMarshaller) { if (putItemRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocol...
Create a Java method that does the following: "marshalls the given PutItemRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java @Override public void mutateMany(Map<String, Map<StaticBuffer, KCVMutation>> mutations, StoreTransaction txh) throws BackendException { Preconditions.checkNotNull(mutations); final MaskedTimestamp commitTime = new MaskedTimestamp(txh); ...
Create a Java method that does the following: "Mutate many rows.".
Of course, here is the Java code you requested: ```java public List<String> load(String[] args) throws IOException { setLogLevel(Level.WARNING); mappings.addJreMappings(); // Create a temporary directory as the sourcepath's first entry, so that // modified sources will take precedence over regular fi...
Create a Java method that does the following: "Load a list of source files from the command line.".
Of course, here is the Java code you requested: ```java protected synchronized ValueSet getAndRemoveFromExplicitBuffer() { final String methodName = "getAndRemoveFromExplicitBuffer()"; ValueSet valueSet = null; if (this.explicitBuffer.size() == 0) { valueSet = new ValueSet(1); ...
Create a Java method that does the following: "Gets and removes from explicit buffer.".
Of course, here is the Java code you requested: ```java private Object unwrap(EntityMetadata entityMetadata, Map<byte[], byte[]> results, Object key) throws InstantiationException, IllegalAccessException { MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMe...
Create a Java method that does the following: "Unwrap the result of a .".
Of course, here is the Java code you requested: ```java public Statistics columnStats(String columnName, ColumnStats columnStats) { Map<String, String> map = normalizeColumnStats(columnStats); this.columnStats.put(columnName, map); return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a column statistics object.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("resource") public SftpFileAttributes get(String remote, String local, FileTransferProgress progress, boolean resume) throws FileNotFoundException, SftpStatusException, SshException, TransferCancelledException { // Moved here to ens...
Create a Java method that does the following: "Get a single file from the remote server.".
Of course, here is the Java code you requested: ```java public static <E> E checkInstanceOf(Class<E> type, Object object, String errorMessage) { isNotNull(type, "type"); if (!type.isInstance(object)) { throw new IllegalArgumentException(errorMessage); } return (E) object; ...
Create a Java method that does the following: "Check if object is an instance of the specified type.".
Of course, here is the Java code you requested: ```java @Override public Long getMaximumLength() { calculator(); if (simple) { return v[3] - v[0]; } else { Weight maxDur = cn.getMaximumDuration(); return maxDur.isInfinity() ? null : maxDur.value(); ...
Create a Java method that does the following: "Gets the maximum length of a phrase.".
Of course, here is the Java code you requested: ```java @Initialize(distributed = false) public void truncateIfNecesary() { if (truncateTable) { final UpdateableDatastoreConnection con = datastore.openConnection(); try { final SchemaNavigator schemaNavigator = con.ge...
Create a Java method that does the following: "Truncate the table if necessary.".
Of course, here is the Java code you requested: ```java public static ASN1Set getLastNameEntry(X500Name name) { RDN[] rdns = name.getRDNs(); int size = rdns.length; return (size > 0) ? (ASN1Set) rdns[size - 1].toASN1Primitive() : null; } ``` Hope this helps!
Create a Java method that does the following: "Get the last name entry from an X500Name.".
Of course, here is the Java code you requested: ```java public static KeyStore findCredentialStore(String provider, String credentialStoreType, String credentialStoreLocation, String credentialStorePassword) throws GlobusSSLConfigurationException { try { KeyStore credentialStore; if (provider == null)...
Create a Java method that does the following: "Find a credential store.".
Of course, here is the Java code you requested: ```java public String getCacheKey() { StringBuilder builder = new StringBuilder(100); builder.append("qdata{"); addCommonCacheKeyParts(builder); if(fetchOptions.getOffset() != null) { builder.append(",off=").append(fetchOptions.getOffset()); } if(fetchOpti...
Create a Java method that does the following: "Returns the cache key.".
Of course, here is the Java code you requested: ```java public DescribeDimensionKeysRequest withFilter(java.util.Map<String, String> filter) { setFilter(filter); return this; } ``` Hope this helps!
Create a Java method that does the following: "A map of dimension keys to be described.".
Of course, here is the Java code you requested: ```java void handleRepeatableAnnotations(final Set<String> allRepeatableAnnotationNames) { if (annotationInfo != null) { annotationInfo.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(), RelType.METHOD_ANNOTA...
Create a Java method that does the following: "Handle repeatable annotations.".
Of course, here is the Java code you requested: ```java static SoyValue getConstantOrNull(ExprNode expr) { switch (expr.getKind()) { case NULL_NODE: return NullData.INSTANCE; case BOOLEAN_NODE: return BooleanData.forValue(((BooleanNode) expr).getValue()); case INTEGER_NODE: ...
Create a Java method that does the following: "Returns the value of the given expression if it is a constant.".
Of course, here is the Java code you requested: ```java private void writeObject(final java.io.ObjectOutputStream out) throws IOException { out.defaultWriteObject(); if (wb != null) { wb.write(out); } } ``` Hope this helps!
Create a Java method that does the following: "Writes a object to the stream.".
Of course, here is the Java code you requested: ```java @NonNull public Transition excludeTarget(@Nullable View target, boolean exclude) { mTargetExcludes = excludeObject(mTargetExcludes, target, exclude); return this; } ``` Hope this helps!
Create a Java method that does the following: "Exclude a target from the transition.".
Of course, here is the Java code you requested: ```java private void handleGetAllMetricName(final int executorId, final HttpServletRequest req, final HashMap<String, Object> ret) throws IOException { final Map<String, Object> result; try { result = this.execManagerAdapter.callExecutorStat...
Create a Java method that does the following: "Handle all metric names for an executor.".
Of course, here is the Java code you requested: ```java public TypeDefinitionRegistry buildRegistry(Document document) { List<GraphQLError> errors = new ArrayList<>(); TypeDefinitionRegistry typeRegistry = new TypeDefinitionRegistry(); List<Definition> definitions = document.getDefinitions(); ...
Create a Java method that does the following: "Build the registry.".
Of course, here is the Java code you requested: ```java public T textSize(float size) { if (view instanceof TextView) { TextView tv = (TextView) view; tv.setTextSize(size); } return self(); } ``` Hope this helps!
Create a Java method that does the following: "Sets the text size of the TextView.".
Of course, here is the Java code you requested: ```java private UIComponent findHeader(UIViewRoot root) { for (UIComponent c : root.getChildren()) { if (c instanceof HtmlHead) return c; } for (UIComponent c : root.getChildren()) { if (c instanceof HtmlBody) return null; if (c instanceof UIOutput...
Create a Java method that does the following: "Find the header component in the given UIViewRoot.".
Of course, here is the Java code you requested: ```java protected Node getXPathResultNode(String select, Document document) throws ConfigurationException, TransformerException, XpathException { return getXPathResultAsDocument(select, document).getDocumentElement(); } ``` Hope this helps!
Create a Java method that does the following: "Get the result node of an XPath query.".
Of course, here is the Java code you requested: ```java @Override public GetRateBasedRuleResult getRateBasedRule(GetRateBasedRuleRequest request) { request = beforeClientExecution(request); return executeGetRateBasedRule(request); } ``` Hope this helps!
Create a Java method that does the following: "Returns the rate - based rule for an App Engine rule.".
Of course, here is the Java code you requested: ```java @Override public void clearCache(CPDefinitionLink cpDefinitionLink) { entityCache.removeResult(CPDefinitionLinkModelImpl.ENTITY_CACHE_ENABLED, CPDefinitionLinkImpl.class, cpDefinitionLink.getPrimaryKey()); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WI...
Create a Java method that does the following: "Clears the cache for the cp definition link.".
Of course, here is the Java code you requested: ```java @Override public View onCreateActionView() { // Create the view and set its data model. ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mShareHistoryFileName); ActivityChooserView activityChooserView = new ActivityC...
Create a Java method that does the following: "Create the action view.".
Of course, here is the Java code you requested: ```java public static int[] get3DSameModeTopLeftPadding(int[] outSize, int[] inSize, int[] kernel, int[] strides, int[] dilation) { int[] eKernel = effectiveKernelSize(kernel, dilation); int[] outPad = n...
Create a Java method that does the following: "Get the 3D same mode top left padding.".
Of course, here is the Java code you requested: ```java public void putContentStream(MIMETypedStream stream) throws StreamIOException { // TODO: refactor to use proper temp file management - FCREPO-718 // for now, write to new temp file, clean up existing location String oldDSLocation = DSLoca...
Create a Java method that does the following: "Put a content stream to the managed content store.".
Of course, here is the Java code you requested: ```java public InternalLocaleBuilder setExtensions(String subtags) throws LocaleSyntaxException { if (subtags == null || subtags.length() == 0) { clearExtensions(); return this; } subtags = subtags.replaceAll(BaseLocale.SEP...
Create a Java method that does the following: "Sets the extensions of the locale.".
Of course, here is the Java code you requested: ```java public Collection<InfraAlertCondition> list(List<String> queryParams) { return HTTP.GET("/v2/alerts/conditions", null, queryParams, INFRA_ALERT_CONDITIONS).get(); } ``` Hope this helps!
Create a Java method that does the following: "Returns the set of infra alert conditions.".
Of course, here is the Java code you requested: ```java public static SoftwareAttribute createSoftwareAttribute(byte software[]) { SoftwareAttribute attribute = new SoftwareAttribute(); attribute.setSoftware(software); return attribute; } ``` Hope this helps!
Create a Java method that does the following: "Creates a SoftwareAttribute.".
Of course, here is the Java code you requested: ```java public static final SICoreConnectionFactory getSICoreConnectionFactory( FactoryType type) throws SIInsufficientDataForFactoryTypeException, SIIncorrectCallException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && _tc.isEntryEnable...
Create a Java method that does the following: "This method is used to get the SICoreConnectionFactory from the factory type.".
Of course, here is the Java code you requested: ```java public <V1, V2> Context withValues(Key<V1> k1, V1 v1, Key<V2> k2, V2 v2) { PersistentHashArrayMappedTrie<Key<?>, Object> newKeyValueEntries = keyValueEntries.put(k1, v1).put(k2, v2); return new Context(this, newKeyValueEntries); } ``` Hope this...
Create a Java method that does the following: "Returns a new context with the specified values.".
Of course, here is the Java code you requested: ```java public static DoubleMoments of( final long count, final double min, final double max, final double sum, final double mean, final double variance, final double skewness, final double kurtosis ) { return new DoubleMoments( count, min, ma...
Create a Java method that does the following: "Gets a DoubleMoments of the specified count.".
Of course, here is the Java code you requested: ```java private static ImmutableMap<IRI, VocabularyEntry> extractVocabulary(@Nonnull Mapping mapping) { return mapping.getRDFAtomPredicates().stream() .filter(p -> p instanceof TriplePredicate) .map(p -> (TriplePredicate) p) .findFirst() .map(p -> extra...
Create a Java method that does the following: "Extract a vocabulary from a mapping".
Of course, here is the Java code you requested: ```java @Override public void endElement(String uri, String localName, String name) throws SAXException { super.endElement(uri, localName, name); String currentPath = StringTools.join(nameStack, "/"); onNode(name,currentPath); nameSta...
Create a Java method that does the following: "Override implementation to call onNode on the last node in the name stack.".
Of course, here is the Java code you requested: ```java public boolean processWorkspaceBeforeDeletion(@Nonnull Job<?,?> project, @Nonnull FilePath workspace, @Nonnull Node node) throws IOException, InterruptedException { if (project instanceof AbstractProject) { return processWorkspaceBeforeDeletio...
Create a Java method that does the following: "Process workspace before deletion.".
Of course, here is the Java code you requested: ```java public boolean selectionChanged(Object source, int iStartRow, int iEndRow, int iSelectType) { int iOldSelection = m_iSelectedRow; if (m_iSelectedRow == iEndRow) m_iSelectedRow = iStartRow; else m_iSelectedRow = ...
Create a Java method that does the following: "The selection changed.".
Of course, here is the Java code you requested: ```java private ClientConnection createHttpClientConnection(final StreamConnection connection, final OptionMap options, final ByteBufferPool bufferPool) { try { Class<?> cls = Class.forName("io.undertow.client.http.HttpClientConnection"); Constructor<?> o = c...
Create a Java method that does the following: "Creates a new HTTP client connection.".
Of course, here is the Java code you requested: ```java public void setStatus(String asgName, boolean enabled) { String asgAccountId = getASGAccount(asgName); asgCache.put(new CacheKey(asgAccountId, asgName), enabled); } ``` Hope this helps!
Create a Java method that does the following: "Sets the status of the ASG.".
Of course, here is the Java code you requested: ```java @Override public E apply(Iterator<E> consumable) { dbc.precondition(consumable != null, "consuming a null iterator"); dbc.precondition(consumable.hasNext(), "no element to consume"); E value = consumable.next(); while (consumab...
Create a Java method that does the following: "This method is called to consume an iterator of elements from a CRA.".
Of course, here is the Java code you requested: ```java @Override public int updateId(DataColumns data, TableColumnKey newId) throws SQLException { int count = 0; DataColumns readData = queryForId(data.getId()); if (readData != null && newId != null) { readData.setId(newId); count = update(readData); ...
Create a Java method that does the following: "Updates the data column with a new id.".
Of course, here is the Java code you requested: ```java @Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WTemplate template = (WTemplate) component; // Setup the context Map<String, Object> context = new HashMap<>(); // Make the component available under t...
Create a Java method that does the following: "Render the given WComponent.".
Of course, here is the Java code you requested: ```java FieldConstraints extractValidationRules() { Annotation[] annotations = field.getAnnotations(); FieldConstraints fieldConstraints = new FieldConstraints(); for (Annotation annotation : annotations) { if (Iterables.contains(relevantAnnotationClas...
Create a Java method that does the following: "Extract validation rules from the field.".
Of course, here is the Java code you requested: ```java public @CheckForNull Authentication authenticate(Queue.Item item) { if (Util.isOverridden(QueueItemAuthenticator.class, getClass(), "authenticate", Queue.Task.class)) { return authenticate(item.task); } else { throw new Abs...
Create a Java method that does the following: "Override the authenticate method of the QueueItemAuthenticator.".
Of course, here is the Java code you requested: ```java private @NotNull Optional<TypeConversion> findConversionFromDbValue(@NotNull Type source, @NotNull Type target) { if (isAssignable(target, source)) return Optional.of(TypeConversion.identity()); Optional<TypeConversion> directConversi...
Create a Java method that does the following: "Find a type conversion from the database value.".
Of course, here is the Java code you requested: ```java public List<ChallengeHandler> lookup(String location) { List<ChallengeHandler> result = Collections.emptyList(); if (location != null) { Node<ChallengeHandler, UriElement> resultNode = findBestMatchingNode(location); if (re...
Create a Java method that does the following: "Lookup a list of challenge handlers for a given location.".
Of course, here is the Java code you requested: ```java public void initializeDefaultPreferences() { IPreferenceStore store = GlassmakerUIPlugin.getDefault().getPreferenceStore(); store.setDefault(PreferenceConstants.CLIENT_ID,"YOU_MUST_PROVIDE_A_CLIENT_ID"); store.setDefault(PreferenceConstants.CLIENT_SECRET...
Create a Java method that does the following: "Initialize the preferences.".
Of course, here is the Java code you requested: ```java private boolean existsResource(String path, boolean rootPath) { CmsObject cms = getCmsObject(); if (rootPath) { String origSiteRoot = cms.getRequestContext().getSiteRoot(); try { cms.getRequestContext().set...
Create a Java method that does the following: "Checks if a resource exists.".
Of course, here is the Java code you requested: ```java public SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map<String, String> tags) { ...
Create a Java method that does the following: "Sets the specified SAS definition in the specified key vault.".
Of course, here is the Java code you requested: ```java public void registerTypeConverter (@Nonnull final ITypeConverterRegistry aRegistry) { // to CommonsList<?> aRegistry.registerTypeConverterRuleAnySourceFixedDestination (ArrayList.class, aSource -> { if (aSource instanceof Collection <?>) r...
Create a Java method that does the following: "Register a type converter.".
Of course, here is the Java code you requested: ```java @Override public UpdateUploadResult updateUpload(UpdateUploadRequest request) { request = beforeClientExecution(request); return executeUpdateUpload(request); } ``` Hope this helps!
Create a Java method that does the following: "Updates an upload.".
Of course, here is the Java code you requested: ```java public static String[] getXlsxWorksheets(InputStream stream) throws IOException { XlsxWorkbook workbook = XlsxWorkbook.getWorkbook(stream); String[] sheets = workbook.getSheetNames(); workbook.close(); return sheets; ...
Create a Java method that does the following: "Get the list of sheets from an input stream.".
Of course, here is the Java code you requested: ```java protected List<Map<String, ?>> generateModifiers(Set<String> modifiers) { final List<Map<String, ?>> list = new ArrayList<>(); if (!modifiers.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(modifiers)); it.style(MODIFIER_STYLE); i...
Create a Java method that does the following: "Generate the modifiers.".
Of course, here is the Java code you requested: ```java private void addFilesToArchive(ZipArchiver archiver, File sourceDir) throws Exception { File generatedPackageFile = new File(sourceDir, PACKAGE_XML); if (generatedPackageFile.exists()) { generatedPackageFile.delete(); } ...
Create a Java method that does the following: "Adds the files to the archive.".
Of course, here is the Java code you requested: ```java public void onSuccess(StreamState state) { logger.info(String.format("[repair #%s] streaming task succeed, returning response to %s", desc.sessionId, request.initiator)); MessagingService.instance().sendOneWay(new SyncComplete(desc, request.sr...
Create a Java method that does the following: "This method is called when a stream is successfully completed.".
Of course, here is the Java code you requested: ```java public static HashMap<String, String> parseAccountString(final String parseString) { // 1. split name value pairs by splitting on the ';' character final String[] valuePairs = parseString.split(";"); final HashMap<String, String> retVals ...
Create a Java method that does the following: "Parses the string passed in into a HashMap of String values.".
Of course, here is the Java code you requested: ```java public void parseActivities(List<Element> activityElements, Element parentElement, ScopeImpl scopeElement) { for (Element activityElement : activityElements) { parseActivity(activityElement, parentElement, scopeElement); } } ``` Hope this helps!
Create a Java method that does the following: "Parse the list of activities.".
Of course, here is the Java code you requested: ```java public List<Integer> getRouteOriginDestination(Integer destination, Integer origin, List<Integer> avoid, List<List<Integer>> connections, String datasource, String flag, String ifNoneMatch) throws ApiException { ApiResponse<List<Integer>> resp...
Create a Java method that does the following: "Get route Origin Get route Origin list of target resources".
Of course, here is the Java code you requested: ```java public static PlotCanvas plot(double[][] data, Line.Style style) { return plot(null, data, style); } ``` Hope this helps!
Create a Java method that does the following: "Create a plot canvas with a single line.".
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.GCFLTRG__XPOS: return XPOS_EDEFAULT == null ? xpos != null : !XPOS_EDEFAULT.equals(xpos); case AfplibPackage.GCFLTRG__YPOS: return YPOS_EDEFAULT == null ? yp...
Create a Java method that does the following: "Replies if the feature is set to the value of the feature.".
Of course, here is the Java code you requested: ```java void updateBPD(HashMap<String, String> result) { log.debug("extracting BPD from results"); HashMap<String, String> newBPD = new HashMap<>(); result.keySet().forEach(key -> { if (key.startsWith("BPD.")) { newBPD...
Create a Java method that does the following: "Update the BPD from the result".
Of course, here is the Java code you requested: ```java private SystemMessages createSystemMessages(Locale locale) { CmsMessages messages = Messages.get().getBundle(locale); CustomizedSystemMessages systemMessages = new CustomizedSystemMessages(); systemMessages.setCommunicationErrorCaption(me...
Create a Java method that does the following: "Creates the system messages.".
Of course, here is the Java code you requested: ```java public static H2ONode self(InetAddress local) { assert H2O.H2O_PORT != 0; try { // Figure out which interface matches our IP address List<NetworkInterface> matchingIfs = new ArrayList<>(); Enumeration<NetworkInterface> netIfs = NetworkIn...
Create a Java method that does the following: "Get the H2O instance for the given local address.".
Of course, here is the Java code you requested: ```java public static <E> Set<E> disjointView(final Set<? extends E> set1, final Set<? extends E> set2) { return Sets.symmetricDifference(set1, set2); } ``` Hope this helps!
Create a Java method that does the following: "Returns the disjoint view of the two sets.".
Of course, here is the Java code you requested: ```java public Pair<Chain> getParentChains() { Atom[] firstMol = this.molecules.getFirst(); Atom[] secondMol = this.molecules.getSecond(); if (firstMol.length==0 || secondMol.length==0) { logger.warn("No atoms found in first or second molecule, can't get parent ...
Create a Java method that does the following: "Get the parent chains of this molecule.".
Of course, here is the Java code you requested: ```java public PrincipalUser getRemoteUser(HttpServletRequest req) { requireArgument(req != null, "Request cannot be null."); if(req.getHeader(HttpHeaders.AUTHORIZATION) != null) { PrincipalUser result = null; Object username =...
Create a Java method that does the following: "Gets the user that is associated with the specified request.".
Of course, here is the Java code you requested: ```java @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); SPFSecurityMonitor securityMonitor = SPF.get().getSecurityMonitor(); String packageIdentifier = intent.getData().getSchemeSpecificPart(); if (action.eq...
Create a Java method that does the following: "Called when the application is being received from the application manager.".
Of course, here is the Java code you requested: ```java protected SDVariable gradientBackwardsMarker(String name, SDVariable x) { SDVariable result = f().gradientBackwardsMarker(x); return updateVariableNameAndReference(result, name); } ``` Hope this helps!
Create a Java method that does the following: "Gradient backward marker operation".
Of course, here is the Java code you requested: ```java public void deployManaged(@Observes DeployManagedDeployments event) throws Exception { forEachManagedDeployment(new Operation<Container, Deployment>() { @Inject private Event<DeploymentEvent> event; @Override ...
Create a Java method that does the following: "Deploys a managed container to a managed container.".
Of course, here is the Java code you requested: ```java public String query(String deviceInfo, String date, BillType type){ checkNotNullAndEmpty(date, "date"); checkNotNull(type, "bill type can't be null"); Map<String, String> downloadParams = buildDownloadParams(deviceInfo, date, type); ...
Create a Java method that does the following: "Query for a specific type of bill".
Of course, here is the Java code you requested: ```java public boolean matchesTag(final UdpChannel udpChannel) { if (!hasTag || !udpChannel.hasTag() || tag != udpChannel.tag()) { return false; } if (udpChannel.remoteData().getAddress().isAnyLocalAddress() && ...
Create a Java method that does the following: "Checks if the udpChannel matches this tag.".
Of course, here is the Java code you requested: ```java private Chronology selectChronology(Chronology chrono) { chrono = DateTimeUtils.getChronology(chrono); if (iChrono != null) { chrono = iChrono; } if (iZone != null) { chrono = chrono.withZone(iZone); ...
Create a Java method that does the following: "Select the chronology to use.".
Of course, here is the Java code you requested: ```java public void setZoneIds(java.util.Collection<String> zoneIds) { if (zoneIds == null) { this.zoneIds = null; return; } this.zoneIds = new com.amazonaws.internal.SdkInternalList<String>(zoneIds); } ``` Hope this ...
Create a Java method that does the following: "Sets the value of the zoneIds property.".
Of course, here is the Java code you requested: ```java @Deprecated public int previous() { if(bufferPos>0 || previousNormalize()) { int c=buffer.codePointBefore(bufferPos); bufferPos-=Character.charCount(c); return c; } else { return DONE; } ...
Create a Java method that does the following: "Get the code point before the current code point.".
Of course, here is the Java code you requested: ```java List<Dimension> constructDimensions(Group group, opendap.dap.DArray dodsArray) { if (group == null) group = rootGroup; List<Dimension> dims = new ArrayList<Dimension>(); Enumeration enumerate = dodsArray.getDimensions(); while (enumerate.hasMoreE...
Create a Java method that does the following: "Construct the dimensions of a given group.".
Of course, here is the Java code you requested: ```java public static <T> QueueFactory<T> boundedNonBlockingQueue(final int queueSize) { return () -> new Queue<T>( new ManyToOneConcurrentArrayQueue<>( queueS...
Create a Java method that does the following: "Create a queue factory that returns a queue bounded to a given size.".
Of course, here is the Java code you requested: ```java private void setEntityManagerPoolSize(String poolSize) { setExtProperty( CmsDbPoolV11.KEY_DATABASE_POOL + '.' + getPool() + '.' + CmsDbPoolV11.KEY_ENTITY_MANAGER_POOL_SIZE, poolSize); } ``` Hope this helps!
Create a Java method that does the following: "Sets the entity manager pool size.".
Of course, here is the Java code you requested: ```java @NullSafe @SafeVarargs public static <T> T getFirst(T... array) { return getFirst(array, null); } ``` Hope this helps!
Create a Java method that does the following: "Gets the first element of an array.".
Of course, here is the Java code you requested: ```java public long getAndSet(final T e, final long occurrences) { checkOccurrences(occurrences); final MutableLong count = valueMap.get(e); long result = count == null ? 0 : count.value(); if (occurrences == 0) { if (...
Create a Java method that does the following: "Gets the value of a angetag entry and sets it to the given value.".
Of course, here is the Java code you requested: ```java void prepare(Map stormConf, TopologyContext context, OutputCollector collector, State state) { init(context, collector); this.collector = new AckTrackingOutputCollector(collector); bolt.prepare(stormConf, context, this.collector); ...
Create a Java method that does the following: "Prepare the record store".
Of course, here is the Java code you requested: ```java public static SampleFetcher fetcher(final String pathAssistantSid, final String pathTaskSid, final String pathSid) { return new SampleFetcher(pathAssistantSid, pathTaskSid, ...
Create a Java method that does the following: "Create a SampleFetcher to execute fetch.".
Of course, here is the Java code you requested: ```java public DBEngineVersion withSupportedEngineModes(String... supportedEngineModes) { if (this.supportedEngineModes == null) { setSupportedEngineModes(new com.amazonaws.internal.SdkInternalList<String>(supportedEngineModes.length)); } ...
Create a Java method that does the following: "Sets the supported engine modes.".
Of course, here is the Java code you requested: ```java public static AuthenticationScheme oauth2(String accessToken) { PreemptiveOAuth2HeaderScheme myScheme = new PreemptiveOAuth2HeaderScheme(); myScheme.setAccessToken(accessToken); return myScheme; } ``` Hope this helps!
Create a Java method that does the following: "Create an OAuth2 AuthenticationScheme".
Of course, here is the Java code you requested: ```java private void handleConnectEvent(ConnectEvent connectEvent) { try { initialize(); channelManager.initialize(); agentManager.initialize(); meetMeManager.initialize(); if (!skipQueues) ...
Create a Java method that does the following: "Handle the ConnectEvent.".
Of course, here is the Java code you requested: ```java boolean corralIfNeeded(Collection<Unit> working) { if (isRecoverable() && si.corralled() != null) { activeGuts = si.corralled(); setWrap(working, working); return isAttemptingCorral = true; } ...
Create a Java method that does the following: "if the test is being performed".
Of course, here is the Java code you requested: ```java private static MessageInfoType mapMessageInfo(MessageInfo messageInfo) { if (messageInfo == null) { return null; } MessageInfoType miType = new MessageInfoType(); miType.setMessageId(messageInfo.getMessageId()); ...
Create a Java method that does the following: "Map message info to a MessageInfoType object.".
Of course, here is the Java code you requested: ```java static Throwable checkedException(final Throwable ex) { Validate.isTrue(ex != null && !(ex instanceof RuntimeException) && !(ex instanceof Error), "Not a checked exception: " + ex); return ex; } ``` Hope this helps!
Create a Java method that does the following: "Check if the exception is a valid CID language exception.".
Of course, here is the Java code you requested: ```java public AwsSecurityFindingFilters withThreatIntelIndicatorLastObservedAt(DateFilter... threatIntelIndicatorLastObservedAt) { if (this.threatIntelIndicatorLastObservedAt == null) { setThreatIntelIndicatorLastObservedAt(new java.util.ArrayList<Da...
Create a Java method that does the following: "Gets the value of the threatIntelIndicatorLastObservedAt property.".
Of course, here is the Java code you requested: ```java public FeatureTableData buildMapClickTableData(LatLng latLng, View view, GoogleMap map, Projection projection) { // Get the zoom level double zoom = MapUtils.getCurrentZoom(map); // Build a bounding box to represent the click location ...
Create a Java method that does the following: "Build the feature table data for the map click location feature table data".
Of course, here is the Java code you requested: ```java protected String copyFileToServer(String destination) throws CmsIllegalArgumentException, CmsRfsException { // get the file item from the multipart request Iterator<FileItem> i = getMultiPartFileItems().iterator(); FileItem fi = null; ...
Create a Java method that does the following: "Copy the file to the server.".
Of course, here is the Java code you requested: ```java private int readMethod(final ClassVisitor classVisitor, final Context context, int u) { // reads the method declaration char[] c = context.buffer; context.access = readUnsignedShort(u); context.name = readUTF8(u + 2, c)...
Create a Java method that does the following: "Reads the method u.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> IDomainFactory<T> getFactory(Class<T> clazz) { for (IDomainFactory<?> factory : instance) { String alias = factory.getAlias(clazz); if (alias != null) { ...
Create a Java method that does the following: "Get a domain factory for the given class.".
Of course, here is the Java code you requested: ```java public static String wordBased(Period period, Duration duration, Locale locale) { Objects.requireNonNull(period, "period must not be null"); Objects.requireNonNull(duration, "duration must not be null"); Objects.requireNonNull(locale, "loc...
Create a Java method that does the following: "Word - based.".
Of course, here is the Java code you requested: ```java public void execute( TransformerImpl transformer) throws TransformerException { try { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); XObject value = m_selectExpression...
Create a Java method that does the following: "Execute the select expression.".
Of course, here is the Java code you requested: ```java @Override public List<ICacheKeyGenerator> getCacheKeyGenerators(IAggregator aggregator) { final String sourceMethod = "getCacheKeyGenerators"; //$NON-NLS-1$ final boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.enterin...
Create a Java method that does the following: "Returns a list of cache key generators for the given aggregator.".
Of course, here is the Java code you requested: ```java public List<T> keySetSorted() { List<T> result = new ArrayList<>(); PriorityQueue<Pair<T, Double>> pq = asPriorityQueue(); while (!pq.isEmpty()) { result.add(pq.poll().getFirst()); } return result; } ``` ...
Create a Java method that does the following: "Get a list of all the attributes in this map sorted by their score.".
Of course, here is the Java code you requested: ```java public void writePropertyObjects(CmsResource res, List<CmsProperty> properties) throws CmsException { getResourceType(res).writePropertyObjects(this, m_securityManager, res, properties); } ``` Hope this helps!
Create a Java method that does the following: "Writes the property objects for the given resource.".
Of course, here is the Java code you requested: ```java public static dospolicy[] get(nitro_service service) throws Exception{ dospolicy obj = new dospolicy(); dospolicy[] response = (dospolicy[])obj.get_resources(service); return response; } ``` Hope this helps!
Create a Java method that does the following: "Use this API to fetch all the dospolicy resources that are configured on netscaler.".
Of course, here is the Java code you requested: ```java public String getElementId() { for (Entry<String, String> attribute : attributes.entrySet()) { if (attribute.getKey().equalsIgnoreCase("id")) { return attribute.getValue(); } } return null; } ``` Hope this helps!
Create a Java method that does the following: "Returns the id of the element.".