code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java @Override public String transform(String regex) { StringBuilder result = new StringBuilder(); UnicodeSet temp = new UnicodeSet(); ParsePosition pos = new ParsePosition(0); int state = 0; // 1 = after \ // We add each c...
Create a Java method that does the following: "Transform a string to a CRS language.".
Of course, here is the Java code you requested: ```java @Override public final void visit(final SourceDocument document) { setBaseObject(new ApiSource(document.getType(), document.getString(), title(document))); addSplitAttributes(document); } ``` Hope this helps!
Create a Java method that does the following: "Visit a SourceDocument. This method will be called for every node in the document tree.".
Of course, here is the Java code you requested: ```java @Override public IRequestHandler mapRequest(final Request request) { for (final RequestMapperBean mapperBean : initializeRequestMappers(request)) { final IRequestHandler handler = mapperBean.getMapper().mapRequest(request); if (handler != null) ...
Create a Java method that does the following: "Override this method to override the default request mapper.".
Of course, here is the Java code you requested: ```java public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsRequestHeaderCQ> queryLambda, ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsRequestHeaderCA> aggsLambda) { RequestHeaderCQ cq = new RequestHeaderC...
Create a Java method that does the following: "Filter a request header by name.".
Of course, here is the Java code you requested: ```java public static String sort(String list, String sortType, String sortOrder, String delimiter) throws PageException { return _sort(toStringArray(listToArray(list, delimiter)), sortType, sortOrder, delimiter); } ``` Hope this helps!
Create a Java method that does the following: "sort a list of strings".
Of course, here is the Java code you requested: ```java private Node<K, V> get(Node<K, V> x, Interval1D<K> interval) { if (x == null) { return null; } int cmp = interval.compareTo(x.interval); if (cmp < 0) { return get(x.left, interval); } else if (cmp > 0) { return get(x.right, i...
Create a Java method that does the following: "Get the node from the left or right side of x.".
Of course, here is the Java code you requested: ```java public OvhInstanceVnc project_serviceName_instance_instanceId_vnc_POST(String serviceName, String instanceId) throws IOException { String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/vnc"; StringBuilder sb = path(qPath, serviceName, instanceId)...
Create a Java method that does the following: "Create a VNC instance".
Of course, here is the Java code you requested: ```java public HttpClientConfig withParams(Map<String, ?> httpClientParams) { return new HttpClientConfig(httpClientFactory, httpClientParams, httpMultipartMode, shouldReuseHttpClientInstance, NO_HTTP_CLIENT, true); } ``` Hope this helps!
Create a Java method that does the following: "Returns a copy of this config with the specified parameters.".
Of course, here is the Java code you requested: ```java public static String trimLeadingCharacter(String str, final char leadingCharacter) { return trimLeadingCharacter(str, new CharacterFilter() { @Override public boolean isCharacterLegal(char character) { return ...
Create a Java method that does the following: "Trims the leading character from the given string.".
Of course, here is the Java code you requested: ```java public static SafeCloseable withContextCustomizer(Consumer<ClientRequestContext> contextCustomizer) { requireNonNull(contextCustomizer, "contextCustomizer"); final Consumer<ClientRequestContext> oldCustomizer = THREAD_LOCAL_CONTEXT_CUSTOMIZER.get...
Create a Java method that does the following: "With context customizer.".
Of course, here is the Java code you requested: ```java public void setRow (final RowVector rv, final int r) throws MatrixException { if ((r < 0) || (r >= m_nRows)) { throw new MatrixException (MatrixException.INVALID_INDEX); } if (m_nCols != rv.m_nCols) { throw new MatrixException (M...
Create a Java method that does the following: "Sets a row of this matrix to the specified row vector.".
Of course, here is the Java code you requested: ```java public HandlerBuilder<ContextHandler> createRootContextHandler(String subPath) { ContextHandler contextHandler = new ContextHandler(); HandlerBuilder<ContextHandler> e = new HandlerBuilder<>(contextHandler); String usePath = contextPath + ...
Create a Java method that does the following: "Create a root context handler.".
Of course, here is the Java code you requested: ```java public static Class[] getGenericTypes(Field field) { try { ParameterizedType type = (ParameterizedType) field.getGenericType(); Type[] types = type.getActualTypeArguments(); Class<?>[] res = new Class<?>[types.length];...
Create a Java method that does the following: "Get generic types of a field.".
Of course, here is the Java code you requested: ```java protected final LocalDate estimateFromOtherEvents( final LocalDate localDate) { if (localDate != null) { return localDate; } final PersonAnalysisVisitor visitor = new PersonAnalysisVisitor(); person.accept(v...
Create a Java method that does the following: "Estimate from other events.".
Of course, here is the Java code you requested: ```java @Override public EClass getIfcSolidModel() { if (ifcSolidModelEClass == null) { ifcSolidModelEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(609); } return ifcSolidModelEClass; } ``` Hop...
Create a Java method that does the following: "Get the IfcSolidModelEClass attribute of the class.".
Of course, here is the Java code you requested: ```java public void marshall(CreateCaseRequest createCaseRequest, ProtocolMarshaller protocolMarshaller) { if (createCaseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "marshalls the given CreateCaseRequest to the JSON object.".
Of course, here is the Java code you requested: ```java public static void setChar(MemorySegment[] segments, int offset, char value) { if (inFirstSegment(segments, offset, 2)) { segments[0].putChar(offset, value); } else { setCharMultiSegments(segments, offset, value); } } ``` Hope this helps!
Create a Java method that does the following: "set char from segments.".
Of course, here is the Java code you requested: ```java public static <T extends Offset<T>> Ordering<OffsetRange<T>> byEndOrdering() { return Ordering.<T>natural().onResultOf(OffsetRange.<T>toEndInclusiveFunction()); } ``` Hope this helps!
Create a Java method that does the following: "Returns an ordering that is on the end of the range of the range.".
Of course, here is the Java code you requested: ```java private DatanodeDescriptor getDatanode(DatanodeID node) { if (node == null) { return null; } DatanodeDescriptor ds = null; try { ds = namesystem.getDatanode(node); } catch (Exception e) { // probably dead on unregistered data...
Create a Java method that does the following: "Get the datanode descriptor for the given node.".
Of course, here is the Java code you requested: ```java public Optional<Epic> getOptionalEpic(Object groupIdOrPath, Integer epicIid) { try { return (Optional.ofNullable(getEpic(groupIdOrPath, epicIid))); } catch (GitLabApiException glae) { return (GitLabApi.createOptionalFromExc...
Create a Java method that does the following: "Get an optional Epic object.".
Of course, here is the Java code you requested: ```java private void growTable() { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "growTable"); int newSize = Math.min(table.length+TABLE_GROWTH_INCREMENT, maxSize); if (tc.isDebugEnabled()) SibTr.debug(this, tc, "existing size="+table.length+" new...
Create a Java method that does the following: "Grows the table by a given amount of space.".
Of course, here is the Java code you requested: ```java public ArrayList<OvhSnapshotEnum> serviceName_partition_partitionName_snapshot_GET(String serviceName, String partitionName) throws IOException { String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot"; StringBuilder sb = path(qPath...
Create a Java method that does the following: "Get snapshot list".
Of course, here is the Java code you requested: ```java public static boolean nullOk(Schema schema) { if (Schema.Type.NULL == schema.getType()) { return true; } else if (Schema.Type.UNION == schema.getType()) { for (Schema possible : schema.getTypes()) { if (nullOk(possible)) { re...
Create a Java method that does the following: "Checks if the schema is null and all its types are null and all its types are union.".
Of course, here is the Java code you requested: ```java @Override public C classify(T classifiable) { if (classifiable == null) { return this.defaultValue; } @SuppressWarnings("unchecked") Class<? extends T> exceptionClass = (Class<? extends T>) classifiable.getClass(); if (this.classified.containsKey(...
Create a Java method that does the following: "Classify an exception.".
Of course, here is the Java code you requested: ```java public static void appendElapsed(StringBuilder buf, long elapsedNanos) { if (elapsedNanos >= 100000000000L) { // >= 100 s buf.append(elapsedNanos / 1000000000L).append("s(").append(elapsedNanos).append("ns)"); } else if (elapsedNanos >...
Create a Java method that does the following: "Append elapsed time to the string buffer.".
Of course, here is the Java code you requested: ```java protected JarFile getJarFile(String jarFileUrl) throws IOException { if (jarFileUrl.startsWith(ResourceUtils.FILE_URL_PREFIX)) { try { return new JarFile(ResourceUtils.toURI(jarFileUrl).getSchemeSpecificPart()); } c...
Create a Java method that does the following: "Get a JarFile from a URL.".
Of course, here is the Java code you requested: ```java public void createTables(TableCreationMode mode) { try (Connection connection = getConnection()) { connection.setAutoCommit(false); createTables(connection, mode, true); connection.commit(); } catch (SQLExceptio...
Create a Java method that does the following: "Create all tables in the database.".
Of course, here is the Java code you requested: ```java @Override public Boolean hSet(byte[] key, byte[] field, byte[] value) { try { if (isPipelined()) { pipeline(new JedisResult(pipeline.hset(key, field, value), JedisConverters.longToBoolean())); return null; ...
Create a Java method that does the following: "HSET operation for a set of a set of a set of a set of a set of a set of a set of keys.".
Of course, here is the Java code you requested: ```java public static Credential getServiceAccountCredential(String serviceAccountId, PrivateKey privateKey, Collection<String> serviceAccountScopes) throws GeneralSecurityException, IOException { return getCredentialBuilderWithoutPrivateKey(serviceAccoun...
Create a Java method that does the following: "Get a service account credential.".
Of course, here is the Java code you requested: ```java private static void addWriter(final Writer writer, final Collection<Writer>[][] matrix, final int tagIndex, final Level level) { for (int levelIndex = level.ordinal(); levelIndex < Level.OFF.ordinal(); ++levelIndex) { Collection<Writer> collection = matrix[t...
Create a Java method that does the following: "Adds a writer to the matrix.".
Of course, here is the Java code you requested: ```java public DescribeSecurityGroupsResult withSecurityGroups(SecurityGroup... securityGroups) { if (this.securityGroups == null) { setSecurityGroups(new com.amazonaws.internal.SdkInternalList<SecurityGroup>(securityGroups.length)); } ...
Create a Java method that does the following: "Adds the security groups to the result.".
Of course, here is the Java code you requested: ```java public StringGrabber removeHeadConsecutiveChars(char charToRemove) { boolean loop = true; if (sb.length() > 0) { while (loop) { if (sb.charAt(0) == charToRemove) { removeHead(1); } else { loop = false; } } } return StringGrabb...
Create a Java method that does the following: "Removes consecutive chars from the head of this string.".
Of course, here is the Java code you requested: ```java public static void execute(RunnableWithException task, Consumer<Throwable> exceptionHandler, Runnable runFinally, Executor executor) { Preconditions.checkNotNull(task, "task"); Preconditions.checkNotNull(exceptionHandler, "exceptionHandler"); ...
Create a Java method that does the following: "Execute a Runnable with exception handler and finally callback.".
Of course, here is the Java code you requested: ```java public ScreenLocation getNextLocation(short position, short setNewAnchor) { if (position == ScreenConstants.NEXT_LOGICAL) position = ScreenConstants.RIGHT_OF_LAST; if (position == ScreenConstants.FIRST_LOCATION) positio...
Create a Java method that does the following: "GetNextLocation Method.".
Of course, here is the Java code you requested: ```java public Message contentEncoding(String charset) { basicProperties = basicProperties.builder() .contentEncoding(charset) .build(); return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets the content encoding of the message.".
Of course, here is the Java code you requested: ```java public Object getAttribute(Object object, String attribute) { return getAttribute(theClass, object, attribute, false, false); } ``` Hope this helps!
Create a Java method that does the following: "Get the attribute value for the given object.".
Of course, here is the Java code you requested: ```java public void deletePublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException { getProjectDriver(dbc).deletePublishJob(dbc, publishHistoryId); } ``` Hope this helps!
Create a Java method that does the following: "Deletes the publish job with the given publish history id.".
Of course, here is the Java code you requested: ```java public VirtualMachineInner beginCreateOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body(); } ``` Ho...
Create a Java method that does the following: "Creates or updates a virtual machine.".
Of course, here is the Java code you requested: ```java @Override public BufferedImage getBackground(int width, int height) { BufferedImage bg = new BufferedImage(width, height, BufferedImage.TRANSLUCENT); Graphics2D g = bg.createGraphics(); g.setComposite(AlphaComposite.getInstance(AlphaC...
Create a Java method that does the following: "Get the background image.".
Of course, here is the Java code you requested: ```java @Override public void connectionReleased(IManagedConnectionEvent<C> event) { IPhynixxManagedConnection<C> proxy = event.getManagedConnection(); if (LOG.isDebugEnabled()) { LOG.debug("Proxy " + proxy + " released"); } }...
Create a Java method that does the following: "Called when a connection is released.".
Of course, here is the Java code you requested: ```java public void markInitialState() { if (!attachedObjects.isEmpty()) { for (T t : attachedObjects) { if (t instanceof PartialStateHolder) { ((PartialStateHolder) t).markInitialState(); } ...
Create a Java method that does the following: "Mark the initial state of the object.".
Of course, here is the Java code you requested: ```java public void info(String message) { if (getLevel() > Level.INFO.ordinal()) return; logMessage(Level.INFO, message, null); } ``` Hope this helps!
Create a Java method that does the following: "Logs a message at the INFO level.".
Of course, here is the Java code you requested: ```java public void addLayoutComponent (Component comp, Object constraints) { if (!(constraints instanceof Point || constraints instanceof Rectangle)) { throw new IllegalArgumentException("Constraints must be " + ...
Create a Java method that does the following: "Add a layout component to the layout.".
Of course, here is the Java code you requested: ```java private static SuggestTree checkIndexName(HttpServletRequest request, ProcessRetrieveResponse response, ServletContext context) { String indexName = request .getParameter(ProtocolConstants.INDEX_PARAMETER); SuggestTree index = null; // if no indexNam...
Create a Java method that does the following: "Check if the indexName parameter is present in the request and return the appropriate SuggestTree.".
Of course, here is the Java code you requested: ```java public void writeManifest(CmsXmlSaxWriter xmlSaxWriter) throws IOException, SAXException { if (m_isExportAsFiles) { writeManifest2Rfs(xmlSaxWriter); } else { writeManifest2Zip(xmlSaxWriter); } } ``` Hope this ...
Create a Java method that does the following: "Write the manifest.".
Of course, here is the Java code you requested: ```java public static boolean unzipFileIntoDirectory(final File zipFile, final String directory) { final Map<ZipEntry, byte[]> zipEntries = new HashMap<ZipEntry, byte[]>(); ZipInputStream zis; try { zis = new ZipInputStream(new Fil...
Create a Java method that does the following: "Unzip the specified file into the specified directory.".
Of course, here is the Java code you requested: ```java public T withParam(String name, String value) { parameters.put(name, value); return self; } ``` Hope this helps!
Create a Java method that does the following: "Sets a parameter to the resource.".
Of course, here is the Java code you requested: ```java protected boolean clear() { log.debug("clear"); super.removeAttributes(); // send confirmation to client ownerMessage.addEvent(Type.CLIENT_CLEAR_DATA, name, null); notifyModified(); changeStats.incrementAndGet...
Create a Java method that does the following: "Removes all the attributes from the entity.".
Of course, here is the Java code you requested: ```java public SynchronizedSet<UUID> getAgents() { final Object mutex = getAgentRepositoryMutex(); synchronized (mutex) { return Collections3.synchronizedSet(this.agents.keySet(), mutex); } } ``` Hope this helps!
Create a Java method that does the following: "Replies the set of agents.".
Of course, here is the Java code you requested: ```java public static String abbreviate(String str, int length, String ellipsis) { Parameters.checkCondition(length > ellipsis.length()); if (str.length() <= length) { return str; } return str.substring(0, length - ellipsis.length()) + ellipsis; } ``` Hope ...
Create a Java method that does the following: "Abbreviates a string.".
Of course, here is the Java code you requested: ```java public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo(String mediaId, String transcodingPresetName) { GenerateMediaDeliveryInfoRequest request = new GenerateMediaDeliveryInfoRequest() .withMediaId(mediaId) .wit...
Create a Java method that does the following: "GenerateMediaDeliveryInfo - API to generate delivery info for a single media".
Of course, here is the Java code you requested: ```java private Stack createPrefixStack(String prefix) { Stack fs = new Stack(); m_namespaces.put(prefix, fs); return fs; } ``` Hope this helps!
Create a Java method that does the following: "Create a Stack for a namespace prefix.".
Of course, here is the Java code you requested: ```java public static ChartPanel createPanel(JFreeChart chart) { ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); panel.setMouseWheelEnabled(true); return panel; } ``` Hope this helps!
Create a Java method that does the following: "Create a ChartPanel with the specified chart.".
Of course, here is the Java code you requested: ```java public ProxyDataSourceBuilder listener(JdbcLifecycleEventListener listener) { JdbcLifecycleEventExecutionListener executionListener = new JdbcLifecycleEventExecutionListener(listener); this.queryExecutionListeners.add(executionListener); t...
Create a Java method that does the following: "Add a listener to the datasource.".
Of course, here is the Java code you requested: ```java private static IndexedTypeSet toRootEntities(ExtendedSearchIntegrator extendedIntegrator, Class<?>... selection) { Set<Class<?>> entities = new HashSet<Class<?>>(); //first build the "entities" set containing all indexed subtypes of "selection". for ( Class...
Create a Java method that does the following: "Creates a set of entities that are not indexed by the given selection.".
Of course, here is the Java code you requested: ```java private void readHeader() { final int type = readUnsignedByte(); if ((type & RESERVED_MASK) != 0) { throw new ArmeriaStatusException( StatusCodes.INTERNAL, DEBUG_STRING + ": Frame header malforme...
Create a Java method that does the following: "Read the header of the message.".
Of course, here is the Java code you requested: ```java public static EthiopicChronology getInstance(DateTimeZone zone, int minDaysInFirstWeek) { if (zone == null) { zone = DateTimeZone.getDefault(); } EthiopicChronology chrono; EthiopicChronology[] chronos = cCache.get(zone...
Create a Java method that does the following: "Gets an instance of the EthiopicChronology class.".
Of course, here is the Java code you requested: ```java private Tuple<Expr> parseInvocationArguments(EnclosingScope scope) { boolean firstTime = true; ArrayList<Expr> args = new ArrayList<>(); while (eventuallyMatch(RightBrace) == null) { if (!firstTime) { match(Comma); } else { firstTime = false; ...
Create a Java method that does the following: "Parses the invocation arguments of an invocation.".
Of course, here is the Java code you requested: ```java public void marshall(ListObjectParentPathsRequest listObjectParentPathsRequest, ProtocolMarshaller protocolMarshaller) { if (listObjectParentPathsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
Create a Java method that does the following: "marshalls the given request to the JSON object.".
Of course, here is the Java code you requested: ```java @Override public void started(ServiceBroker broker) throws Exception { super.started(broker); serializer.started(broker); logger.info(nameOf(this, true) + " will use " + nameOf(serializer, true) + '.'); // Create cache OHCacheBuilder<byte[], by...
Create a Java method that does the following: "Called by the cache manager to start the cache.".
Of course, here is the Java code you requested: ```java protected void bitcoinSerializeToStream(OutputStream stream, boolean useSegwit) throws IOException { // version uint32ToByteStreamLE(version, stream); // marker, flag if (useSegwit) { stream.write(0); stream...
Create a Java method that does the following: "Serialize this transaction to the given output stream.".
Of course, here is the Java code you requested: ```java public static void serializeXMLDocument (Document doc, Writer output) throws TransformerException { // serialize XML document using identity transformation Transformer trans = TransformerFactory.newInstance().newTransformer(); DOMSource so...
Create a Java method that does the following: "Serialize XML document using identity transformation.".
Of course, here is the Java code you requested: ```java public static PipelineOptions tweakOptions(PipelineOptions opts) { if (!DataflowRunner.class.isAssignableFrom(opts.getRunner())) { return opts; } DataflowPipelineOptions dataflowOpts = opts.as(DataflowPipelineOptions.class); // By default, ...
Create a Java method that does the following: "Tweak the pipeline options to be a CRA - specific type".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") protected void addArrayValue(AnnotationValueImpl annotationValue) { ((List<AnnotationValueImpl>) getArrayValue()).add(annotationValue); this.stringValue = null; } ``` Hope this helps!
Create a Java method that does the following: "Add an array value to the array value.".
Of course, here is the Java code you requested: ```java @Override public List<CommerceShipmentItem> findByGroupId(long groupId, int start, int end) { return findByGroupId(groupId, start, end, null); } ``` Hope this helps!
Create a Java method that does the following: "Returns a range of commerce shipment items matching the group id.".
Of course, here is the Java code you requested: ```java public DeviceTypesInfoEnvelope updateDeviceTypesInfo(String dtid, DeviceTypesInfo deviceTypeInfo) throws ApiException { ApiResponse<DeviceTypesInfoEnvelope> resp = updateDeviceTypesInfoWithHttpInfo(dtid, deviceTypeInfo); return resp.getData(); ...
Create a Java method that does the following: "Update DeviceTypes Info Update DeviceTypes Info".
Of course, here is the Java code you requested: ```java public static String removeFileExtension( String filename ) { String result = filename; int index = filename.lastIndexOf( '.' ); if( index != -1 ) result= filename.substring( 0, index ); return result; } ``` Hope this helps!
Create a Java method that does the following: "Remove file extension from filename.".
Of course, here is the Java code you requested: ```java public V put(K key, V value) { final Object k = maskNull(key); retryAfterResize: for (;;) { final Object[] tab = table; final int len = tab.length; int i = hash(k, len); for (Object item; (item = t...
Create a Java method that does the following: "Put a value into the cache.".
Of course, here is the Java code you requested: ```java public final void setCurrentAccYear( final Date pCurrentAccYear) { if (pCurrentAccYear == null) { this.currentAccYear = null; } else { this.currentAccYear = new Date(pCurrentAccYear.getTime()); } } ``` Hope this helps!
Create a Java method that does the following: "Set the Current AccYear.".
Of course, here is the Java code you requested: ```java public static <Type> PooledLinkedListIterator<Type> iterate(final PooledLinkedList<Type> list) { return new PooledLinkedListIterator<Type>(list); } ``` Hope this helps!
Create a Java method that does the following: "Iterate over the given list.".
Of course, here is the Java code you requested: ```java public void marshall(BatchUpdatePhoneNumberRequest batchUpdatePhoneNumberRequest, ProtocolMarshaller protocolMarshaller) { if (batchUpdatePhoneNumberRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
Create a Java method that does the following: "Creates the given parameter object.".
Of course, here is the Java code you requested: ```java public void detachSbbEntity(SbbEntityID sbbEntityId) throws javax.slee.TransactionRequiredLocalException { boolean detached = cacheData.detachSbbEntity(sbbEntityId); if (detached && acReferencesHandler != null && !isEnding()) { acReferencesHandler.sbb...
Create a Java method that does the following: "Detaches the sbb entity from the cache.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> T[] insert(T[] buffer, int index, T... newElements) { return (T[]) insert((Object)buffer, index, newElements); } ``` Hope this helps!
Create a Java method that does the following: "Inserts the specified elements into the specified array at the specified index.".
Of course, here is the Java code you requested: ```java public static String getDisplayLanguageWithDialect(String localeID, ULocale displayLocale) { return getDisplayLanguageInternal(new ULocale(localeID), displayLocale, true); } ``` Hope this helps!
Create a Java method that does the following: "Get the display language with dialect.".
Of course, here is the Java code you requested: ```java public static String encryptToBase64Url(String url) { url = encryptToBase64(url); if (url.indexOf("+") != -1) { url = url.replaceAll("\\+", "*"); } if (url.indexOf("/") != -1) { url = url.replaceAll("/", "_"...
Create a Java method that does the following: "encryptToBase64Url This method is used to encrypt a URL in base64 format.".
Of course, here is the Java code you requested: ```java protected final void firePrimitiveChanged() { final BusChangeEvent event = new BusChangeEvent( // source of the event this, // type of the event BusChangeEventType.change(getClass()), // subobject this, // index in parent indexIn...
Create a Java method that does the following: "Fire a BusChangeEvent that indicates that the value of the property value of the property value is changed.".
Of course, here is the Java code you requested: ```java @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.FNNRG__GCGID: setGCGID((String)newValue); return; case AfplibPackage.FNNRG__TS_OFFSET: setTSOffset((Integer)newValue); return; } supe...
Create a Java method that does the following: "Override the eSet method to set the value of the featureID in the target object.".
Of course, here is the Java code you requested: ```java private void putElement(final String elemName, final Attributes atts, final boolean removeConref) throws SAXException { //parameter boolean removeConref specifies whether to remove //conref information like @conref @conaction in current element ...
Create a Java method that does the following: "Put an element to the pushcontent.".
Of course, here is the Java code you requested: ```java public static void main(String[] args) throws Exception { CustomHeaderClient client = new CustomHeaderClient("localhost", 50051); try { /* Access a service running on the local machine on port 50051 */ String user = "world"; if (args.len...
Create a Java method that does the following: "Main method to run the CRS client.".
Of course, here is the Java code you requested: ```java public static WeekFields of(Locale locale) { Jdk8Methods.requireNonNull(locale, "locale"); locale = new Locale(locale.getLanguage(), locale.getCountry()); // elminate variants // obtain these from GregorianCalendar for now Gregor...
Create a Java method that does the following: "Gets a WeekFields instance for the given locale.".
Of course, here is the Java code you requested: ```java private static boolean isInheritIOBroken() { if (!System.getProperty("os.name", "none").toLowerCase().contains("windows")) { return false; } String runtime = System.getProperty("java.runtime.version"); if (!runtime.star...
Create a Java method that does the following: "Check if the system is broken by the user.".
Of course, here is the Java code you requested: ```java public java.util.List<String> getSupportedTierList() { if (supportedTierList == null) { supportedTierList = new com.amazonaws.internal.SdkInternalList<String>(); } return supportedTierList; } ``` Hope this helps!
Create a Java method that does the following: "Gets the value of the supportedTierList property.".
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.GRLINERG__XOSSF: return getXOSSF(); case AfplibPackage.GRLINERG__YOFFS: return getYOFFS(); } return super.eGet(featureID,...
Create a Java method that does the following: "Override eGet to return the object that corresponds to the featureID.".
Of course, here is the Java code you requested: ```java public static int validate(String... argv) throws InterruptedException { if (argv.length < 1) { printHelp("Target not specified."); return -2; } String command = argv[0]; String name = null; String[] args; int argsLength = 0; ...
Create a Java method that does the following: "Validate the command line arguments and execute the tasks.".
Of course, here is the Java code you requested: ```java private DefiningClassLoader getQueryClassLoader(CubeClassLoaderCache.Key key) { if (classLoaderCache == null) return classLoader; return classLoaderCache.getOrCreate(key); } ``` Hope this helps!
Create a Java method that does the following: "Get the class loader for the query class.".
Of course, here is the Java code you requested: ```java public static clusternode[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ clusternode obj = new clusternode(); options option = new options(); option.set_filter(filter); clusternode[] response = (clusternode[]) obj.getfiltere...
Create a Java method that does the following: "Use this API to fetch filtered set of clusternode resources. set the filter parameter values in filtervalue object.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static Iterator<Object> iterator(Object iterable) { Assert.state(isIterable(iterable.getClass())); return iterable.getClass().isArray() ? new ArrayIterator(iterable) : ((Iterable<Object>) iterable).itera...
Create a Java method that does the following: "Returns an iterator over the specified object.".
Of course, here is the Java code you requested: ```java private void mergeGlobalProperties(Map<String, Object> globalProperties, Map<String, Object> keenProperties, Map<String, Object> newEvent) { if (globalProperties != null) { // Clone globals so we don't mo...
Create a Java method that does the following: "Merge global properties with keen properties.".
Of course, here is the Java code you requested: ```java @Override public Filter[] filterChainToArray() { int length = chainLength(); Filter[] array = new Filter[length]; Filter thisFilter = this; for (int i = 0; i < length; i++) { array[i] = thisFilter; thisF...
Create a Java method that does the following: "This method is a convenience method for converting a chain of filters to an array of filters.".
Of course, here is the Java code you requested: ```java public CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, CmsXmlContent content) throws CmsException { Locale locale = getLocaleToUse(cms, content); String oldSiteRoot = cms.getRequestContext().getSiteRoot(); try { c...
Create a Java method that does the following: "Parses the given content and returns a CmsDynamicFunctionBean object.".
Of course, here is the Java code you requested: ```java public static List<Point3d> atomsToPoints(Collection<Atom> atoms) { ArrayList<Point3d> points = new ArrayList<>(atoms.size()); for (Atom atom : atoms) { points.add(atom.getCoordsAsPoint3d()); } return points; } ``` Hope this helps!
Create a Java method that does the following: "Converts a collection of atoms to a list of points.".
Of course, here is the Java code you requested: ```java public void marshall(DirectoryConnectSettingsDescription directoryConnectSettingsDescription, ProtocolMarshaller protocolMarshaller) { if (directoryConnectSettingsDescription == null) { throw new SdkClientException("Invalid argument passed to...
Create a Java method that does the following: "marshalls the given DirectoryConnectSettingsDescription to the JSON object.".
Of course, here is the Java code you requested: ```java public String convertIfcRibPlateDirectionEnumToString(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 an object to a String.".
Of course, here is the Java code you requested: ```java public PagedList<ResourceMetricInner> listWorkerPoolInstanceMetricsNext(final String nextPageLink) { ServiceResponse<Page<ResourceMetricInner>> response = listWorkerPoolInstanceMetricsNextSinglePageAsync(nextPageLink).toBlocking().single(); return...
Create a Java method that does the following: "Gets the next page of metrics in a worker pool instance.".
Of course, here is the Java code you requested: ```java public void dispatchOnFxThread(Action action) { if(Platform.isFxApplicationThread()) { actionStream.push(action); } else { Platform.runLater(() -> actionStream.push(action)); } } ``` Hope this helps!
Create a Java method that does the following: "Dispatch an action on the fly thread.".
Of course, here is the Java code you requested: ```java @Nonnull public static <T> LObjIntConsumer<T> objIntConsumerFrom(Consumer<LObjIntConsumerBuilder<T>> buildingFunction) { LObjIntConsumerBuilder builder = new LObjIntConsumerBuilder(); buildingFunction.accept(builder); return builder.build(); } ``` Hope t...
Create a Java method that does the following: "Create a LObjIntConsumer from a Consumer.".
Of course, here is the Java code you requested: ```java public static void removeAllThreadIdentityServices() { threadIdentityServices.clear(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "All the ThreadIdentityService implementations were removed."); ...
Create a Java method that does the following: "Removes all the ThreadIdentityService implementations from the ThreadIdentityService map.".
Of course, here is the Java code you requested: ```java private Map<String, String> getLocaleIdToRulesIdMap(PluralType type) { checkBuildRulesIdMaps(); return (type == PluralType.CARDINAL) ? localeIdToCardinalRulesId : localeIdToOrdinalRulesId; } ``` Hope this helps!
Create a Java method that does the following: "Get the locale - to - rules - id map.".
Of course, here is the Java code you requested: ```java private static boolean isResolvedTypeMatch( Method genericMethod, Method candidateMethod, Class<?> declaringClass) { Type[] genericParameters = genericMethod.getGenericParameterTypes(); Class<?>[] candidateParameters = candidateMethod.getParameterTypes(); ...
Create a Java method that does the following: "Checks if the resolved type of the given method matches the given type.".
Of course, here is the Java code you requested: ```java private ArrayList getListener() { if (_listeners != null) return _listeners; synchronized (this) { if (_listeners != null) return _listeners; _listeners = new ArrayList(); } r...
Create a Java method that does the following: "Get the list of listeners.".