code
stringlengths
160
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public <D> DtoQuery<D> asDto(Class<D> dtoClass) { return query.asDto(dtoClass); } ``` Hope this helps!
Create a Java method that does the following: "Returns the DTO query as a DTO query of the given class.".
Of course, here is the Java code you requested: ```java public Reader getCharacterStream(long pos, long length) throws SQLException { if (length > Integer.MAX_VALUE) { throw Util.outOfRangeArgument("length: " + length); } return new StringReade...
Create a Java method that does the following: "Gets a character stream from the current position in the current row of the database.".
Of course, here is the Java code you requested: ```java public static CSTable table(File file, String name) throws IOException { return new FileTable(file, name); } ``` Hope this helps!
Create a Java method that does the following: "Create a CSTable from a file.".
Of course, here is the Java code you requested: ```java public final CountedCompleter<?> nextComplete() { CountedCompleter<?> p; if ((p = completer) != null) return p.firstComplete(); else { quietlyComplete(); return null; } } ``` Hope this helps!
Create a Java method that does the following: "Returns the next complete phrase.".
Of course, here is the Java code you requested: ```java public static String getMessageSelector(String eventName, IPublisherInfo publisherInfo) { StringBuilder sb = new StringBuilder( "(JMSType='" + eventName + "' OR JMSType LIKE '" + eventName + ".%') AND (Recipients IS NULL"); ...
Create a Java method that does the following: "Gets the message selector.".
Of course, here is the Java code you requested: ```java public static vm_device[] get_filtered(nitro_service service, String filter) throws Exception { vm_device obj = new vm_device(); options option = new options(); option.set_filter(filter); vm_device[] response = (vm_device[]) obj.getfiltered(service,...
Create a Java method that does the following: "Use this API to fetch filtered set of vm_device resources. set the filter parameter values in filter parameter value.".
Of course, here is the Java code you requested: ```java public String get (String key, Object... args) { // First make the key for GWT-friendly return fetch(key.replace('.', '_'), args); } ``` Hope this helps!
Create a Java method that does the following: "Get a value from the cache.".
Of course, here is the Java code you requested: ```java public Clustering<SubspaceModel> run(Database db, Relation<V> relation) { if(mu >= relation.size()) { throw new AbortException("Parameter mu is chosen unreasonably large. This won't yield meaningful results."); } DiSHClusterOrder opticsResult = ...
Create a Java method that does the following: "Run the algorithm on the given database and relation.".
Of course, here is the Java code you requested: ```java public void setUsernameStyle(@UsernameStyle int style) { if (style == EMAIL || !usernameRequired) { setDataType(DataType.EMAIL); } else if (style == USERNAME) { setDataType(DataType.USERNAME); String errorDescri...
Create a Java method that does the following: "setUsernameStyle This method sets the type of the record based on the usernameStyle value.".
Of course, here is the Java code you requested: ```java @Override ResolveResult<? extends AbstractConfigValue> resolveSubstitutions(ResolveContext context, ResolveSource source) { ResolveContext newContext = context.addCycleMarker(this); AbstractConfigValue v; try { ResolveSourc...
Create a Java method that does the following: "Override this method to perform recursive resolution of substitutions.".
Of course, here is the Java code you requested: ```java public void setDigitStrings(String[] digitStrings) { if (digitStrings == null) { throw new NullPointerException("The input digit string array is null"); } if (digitStrings.length != 10) { throw new IllegalArgumentEx...
Create a Java method that does the following: "Sets the digit strings.".
Of course, here is the Java code you requested: ```java public static String getDomainFromURL(String strURL, String strContextPathAtEnd) { return Utility.getDomainFromURL(strURL, strContextPathAtEnd, false); } ``` Hope this helps!
Create a Java method that does the following: "Get the domain from this URL.".
Of course, here is the Java code you requested: ```java public int get(String name, int defaultValue) throws IllegalArgumentException { ObjectSlot slot = findMandatorySlot(name, int.class); return slot.defaulted ? defaultValue : ((Integer) slot.fieldValue).intValue(); } ``` Hope this helps!
Create a Java method that does the following: "Get the value of an integer field.".
Of course, here is the Java code you requested: ```java public static <T> T unmarshal(final JAXBContext ctx, final String xmlData, final XmlAdapter<?, ?>[] adapters) { if (xmlData == null) { return null; } return unmarshal(ctx, new StringReader(xmlData), adapters); } ``` Hope t...
Create a Java method that does the following: "Unmarshals an XML string into an object.".
Of course, here is the Java code you requested: ```java private void flushInternal() throws IOException { isClosed(); dfsClient.checkOpen(); long toWaitFor; synchronized (this) { enqueueCurrentPacket(); toWaitFor = lastQueuedSeqno; } waitForAckedSeqno(toWaitFor); } ``` Hope thi...
Create a Java method that does the following: "Flushes the data to the file.".
Of course, here is the Java code you requested: ```java private void updateStyle(JSeparator sep) { SeaGlassContext context = getContext(sep, ENABLED); SynthStyle oldStyle = style; style = SeaGlassLookAndFeel.updateStyle(context, this); if (style != oldStyle) { if (se...
Create a Java method that does the following: "Update the style of a separator.".
Of course, here is the Java code you requested: ```java private PostCreateAction listenForLibraryChanges(final String libid) { return new PostCreateAction() { @Override public void invoke(AppClassLoader acl) { listenForLibraryChanges(libid, acl); } };...
Create a Java method that does the following: "Creates a post create action that will listen for library changes.".
Of course, here is the Java code you requested: ```java public void calculate(ServiceMessage message) { // client to service eval( message.header(SERVICE_RECV_TIME), message.header(CLIENT_SEND_TIME), (v1, v2) -> clientToServiceTimer.update(v1 - v2, TimeUnit.MILLISECONDS)); // servi...
Create a Java method that does the following: "Calculate the time stamp for the service message.".
Of course, here is the Java code you requested: ```java private void performSubmittedInlineWork(Work work) throws Exception { String attachmentName = work.getAttachmentName(); FileConversionContext conversionContext = new FileConversionContextImpl(work,documentDbDesign,mediaDir); DocumentDescriptor docDe...
Create a Java method that does the following: "This method is called when an inline file is submitted.".
Of course, here is the Java code you requested: ```java private static List<String> tryLoadInstantRunDexFile(ApplicationInfo applicationInfo) { List<String> instantRunSourcePaths = new ArrayList<>(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && null != applicationInfo.splitSourceDirs) ...
Create a Java method that does the following: "Try to load the InstantRun dex file.".
Of course, here is the Java code you requested: ```java public static <R> R supplierByBoolean(boolean bool, Supplier<R> trueSupplier, Supplier<R> falseSupplier) { return bool ? trueSupplier.get() : falseSupplier.get(); } ``` Hope this helps!
Create a Java method that does the following: "Supplier by boolean.".
Of course, here is the Java code you requested: ```java public Extension createExtension(final Bundle bundle) { NullArgumentException.validateNotNull(bundle, "Bundle"); if (bundle.getState() != Bundle.ACTIVE) { LOG.debug("Bundle is not in ACTIVE state, ignore it!"); return null; } // Check compatibility...
Create a Java method that does the following: "Create an extension from a Bundle.".
Of course, here is the Java code you requested: ```java private static ImmutableList<Node> paramNamesOf(Node paramList) { checkArgument(paramList.isParamList(), paramList); ImmutableList.Builder<Node> builder = ImmutableList.builder(); paramNamesOf(paramList, builder); return builder.build(); } ``` ...
Create a Java method that does the following: "Returns the parameter names of the given parameter list.".
Of course, here is the Java code you requested: ```java public void interpret( Specification table ) { Example row = table.nextExample(); Example display = row.firstChild(); Example anchor = display.lastSibling(); Action action = Action.parse( actionCells(row) ); try ...
Create a Java method that does the following: "Interprets the table.".
Of course, here is the Java code you requested: ```java private static <T extends UIObject> String styleElement(Element element, String animation, int count, int duration, int delay) { if (!usedStyles.contains(animation + " " + getStyleNameFromAnimation(animation,count,duration,delay))) { String ...
Create a Java method that does the following: "Get the style element for an animation.".
Of course, here is the Java code you requested: ```java @Nullable public static Long parseLongObj (@Nullable final Object aObject, @Nullable final Long aDefault) { return parseLongObj (aObject, DEFAULT_RADIX, aDefault); } ``` Hope this helps!
Create a Java method that does the following: "Parse a long object from a object with a default radix.".
Of course, here is the Java code you requested: ```java private boolean expandCompositCharAtEnd(char[] dest,int start, int length, int lacount){ boolean spaceNotFound = false; if (lacount > countSpacesLeft(dest, start, length)) { spaceNotFound = true; return ...
Create a Java method that does the following: "Expands a character array at the end of a sequence of characters.".
Of course, here is the Java code you requested: ```java private String getInjectionSetting(final String input, final char startDelim) { return input == null || input.equals("") ? null : StringUtilities.split(input, startDelim)[0].trim(); } ``` Hope this helps!
Create a Java method that does the following: "Get the injection setting.".
Of course, here is the Java code you requested: ```java public String getTopicSpaceBusName() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getTopicSpaceBusName"); SibTr.exit(this, tc, "getTopicSpaceBusName", topicSpaceBusName); ...
Create a Java method that does the following: "Gets the topicSpaceBusName.".
Of course, here is the Java code you requested: ```java @Override public void setRequireFeature(Collection<String> feats) { // No need to copy (like we do in addRequireFeatureWithTolerates) // as we are overwriting anyway // It would be nice if this delegated to setRequireFeatureWithTolerat...
Create a Java method that does the following: "Override the default RequireFeatureWithTolerates feature.".
Of course, here is the Java code you requested: ```java public void respondUsing(final RespondWithBlob callback) throws IOException { RespondWithData dataCallback = new RespondWithData() { @Override public Data onInterest(Name prefix, Interest interest) throws Exception { Data data = new Data(i...
Create a Java method that does the following: "Respond using a RespondWithBlob callback.".
Of course, here is the Java code you requested: ```java public IPreferenceStore getWritablePreferenceStore(Object context) { if (this.preferenceStore == null) { this.preferenceStore = getPreferenceStoreAccess().getWritablePreferenceStore(context); } return this.preferenceStore; } ``` Hope this helps!
Create a Java method that does the following: "Replies the writable preference store for this context.".
Of course, here is the Java code you requested: ```java public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); } ``` Hope this helps!
Create a Java method that does the following: "Returns the default flags for the NTLMSSP header.".
Of course, here is the Java code you requested: ```java public LinkedWorkspaceInner get(String resourceGroupName, String automationAccountName) { return getWithServiceResponseAsync(resourceGroupName, automationAccountName).toBlocking().single().body(); } ``` Hope this helps!
Create a Java method that does the following: "Gets the LinkedWorkspace resource.".
Of course, here is the Java code you requested: ```java public <O> CursorList<O> transform(Function<? super J, ? extends O> function, Predicate<? super O> predicate) { Collection<O> result = null; if (function != null) { result = Lists.transform(this.data, function); } else { result = (List) this.data; }...
Create a Java method that does the following: "Transform the source data with the given function and predicate.".
Of course, here is the Java code you requested: ```java public static final UnboundRecordFilter column(final String columnPath, final ColumnPredicates.Predicate predicate) { checkNotNull(columnPath, "columnPath"); checkNotNull(predicate, "predicate"); retur...
Create a Java method that does the following: "Create a new unbound record filter for the specified column.".
Of course, here is the Java code you requested: ```java public IfcActionRequestTypeEnum createIfcActionRequestTypeEnumFromString(EDataType eDataType, String initialValue) { IfcActionRequestTypeEnum result = IfcActionRequestTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( ...
Create a Java method that does the following: "Converts a String to a IfcActionRequestTypeEnum.".
Of course, here is the Java code you requested: ```java public static Class[] getParameters(String signature) throws FacesException { ArrayList<Class> params = new ArrayList<Class>(); // Signature is of the form // <return-type> S <method-name S? '(' // < <arg-type> ( ',' <arg-type>...
Create a Java method that does the following: "Get the parameters from a method signature.".
Of course, here is the Java code you requested: ```java public Counter counter(String name, Iterable<Tag> tags) { return Counter.builder(name).tags(tags).register(this); } ``` Hope this helps!
Create a Java method that does the following: "Create a new counter with the specified name and tags.".
Of course, here is the Java code you requested: ```java @Override public BlockTypeDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException { CFG cfg = getCFG(analysisCache, descriptor); DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, desc...
Create a Java method that does the following: "This method is used to perform the actual analysis of a class method.".
Of course, here is the Java code you requested: ```java private void clearPipelineError() { File dir = new File(buildDirectory, "pipeline"); if (dir.isDirectory()) { try { FileUtils.cleanDirectory(dir); } catch (IOException e) { getLog().warn("Can...
Create a Java method that does the following: "Clear the pipeline error.".
Of course, here is the Java code you requested: ```java private void initialize() { java.awt.GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); this.setLayout(new GridBagLayout()); this.setSize(375, 204); this.setName("categoryPanel"); gridBagConstraints1...
Create a Java method that does the following: "Initialize the related attributes of the class.".
Of course, here is the Java code you requested: ```java @Override public BsonType readBsonType() { if (isClosed()) { throw new IllegalStateException("This instance has been closed"); } if (getState() == State.INITIAL || getState() == State.DONE || getState() == State.SCOPE_DOCUM...
Create a Java method that does the following: "Reads the BsonType from the current token.".
Of course, here is the Java code you requested: ```java @Nullable public <T extends View> T findViewByIdEfficient(int parentId, int id) { return mCacheView.findViewByIdEfficient(parentId, id); } ``` Hope this helps!
Create a Java method that does the following: "Find a view by its id.".
Of course, here is the Java code you requested: ```java public static void error(Log log, Throwable e, String format, Object... arguments) { if (false == log(log, Level.ERROR, e, format, arguments)) { log.error(e, format, arguments); } } ``` Hope this helps!
Create a Java method that does the following: "Logs an error with a throwable.".
Of course, here is the Java code you requested: ```java public java.util.Map<String, IdentityDkimAttributes> getDkimAttributes() { if (dkimAttributes == null) { dkimAttributes = new com.amazonaws.internal.SdkInternalMap<String, IdentityDkimAttributes>(); } return dkimAttributes; ...
Create a Java method that does the following: "Gets the value of the dkimAttributes property.".
Of course, here is the Java code you requested: ```java public static ExtendedKeyUsages getExtendedKeyUsages(ExtendedKeyUsage usages) { if (usages == null) { return null; } List<String> usageStr = new ArrayList<String>(); for (KeyPurposeId keyPurposeId : usages.getUsag...
Create a Java method that does the following: "Get an ExtendedKeyUsages object from an extendedKeyUsage object.".
Of course, here is the Java code you requested: ```java public static boolean sameDay(ZonedDateTime d1, ZonedDateTime d2) { DateTimeField field = greatestDifference(d1, d2); return (field != YEAR && field != MONTH && field != DAY); } ``` Hope this helps!
Create a Java method that does the following: "Returns true if two date - time objects are the same day.".
Of course, here is the Java code you requested: ```java public java.util.List<String> getListenerArns() { if (listenerArns == null) { listenerArns = new com.amazonaws.internal.SdkInternalList<String>(); } return listenerArns; } ``` Hope this helps!
Create a Java method that does the following: "Gets the value of the listenerArns property.".
Of course, here is the Java code you requested: ```java public void configureAtoms(IAtomContainer container) { for (int f = 0; f < container.getAtomCount(); f++) { configure(container.getAtom(f)); } } ``` Hope this helps!
Create a Java method that does the following: "Configure the atom types of the given atom container.".
Of course, here is the Java code you requested: ```java public void addHeading(String heading, int row) { layoutComponents.add( new LayoutComponent( heading, 0, row, null)); } ``` Hope this helps!
Create a Java method that does the following: "Add a heading to the layout.".
Of course, here is the Java code you requested: ```java public static SslHandler createSslHandler(final boolean clientMode) { final SSLEngine engine = createEngine(clientMode); final SslHandler handler = new SslHandler(engine); handler.handshakeFuture().addListener(new GenericFutureListener<Fut...
Create a Java method that does the following: "Create a SslHandler.".
Of course, here is the Java code you requested: ```java public GlobalProperties filterByNodesConstantSet(OptimizerNode node, int input) { // check if partitioning survives if (this.ordering != null) { for (int col : this.ordering.getInvolvedIndexes()) { if (!node.isFieldConstant(input, col)) { return n...
Create a Java method that does the following: "Filter by nodes constant set.".
Of course, here is the Java code you requested: ```java public EList<MMTRG> getRG() { if (rg == null) { rg = new EObjectContainmentEList.Resolving<MMTRG>(MMTRG.class, this, AfplibPackage.MMT__RG); } return rg; } ``` Hope this helps!
Create a Java method that does the following: "Replies the list of MMTRG objects.".
Of course, here is the Java code you requested: ```java public ApiSuccessResponse clear(String id, ClearData clearData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = clearWithHttpInfo(id, clearData); return resp.getData(); } ``` Hope this helps!
Create a Java method that does the following: "Clear a single language Set the language".
Of course, here is the Java code you requested: ```java public String encode(Cookie cookie) { final String name = checkNotNull(cookie, "cookie").name(); final String value = cookie.value() != null ? cookie.value() : ""; validateCookie(name, value); StringBuilder buf = stringBuilder();...
Create a Java method that does the following: "Encode a Cookie object into a String.".
Of course, here is the Java code you requested: ```java public static List<SiftsEntity> getSiftsMapping(String pdbId) throws IOException{ // grab files from here: AtomCache cache = new AtomCache(); String path = cache.getCachePath(); pdbId = pdbId.toLowerCase(); String dirHash = pdbId.substring(1,3); F...
Create a Java method that does the following: "Get the mapping of the SIFTS files from the cache.".
Of course, here is the Java code you requested: ```java public static int cublasSgemv( cublasHandle handle, int trans, int m, int n, Pointer alpha, /** host or device pointer */ Pointer A, int lda, Pointer x, int incx, Po...
Create a Java method that does the following: "CublasSgemv - Vector format.".
Of course, here is the Java code you requested: ```java @NullSafe public static <T> T[] shuffle(T[] array) { if (isNotEmpty(array)) { Random random = new Random(System.currentTimeMillis()); for (int index = 0, lengthMinusOne = array.length - 1; index < lengthMinusOne; index++) { int rando...
Create a Java method that does the following: "Randomly shuffle the array.".
Of course, here is the Java code you requested: ```java NamePieces parseName(String name) { NamePieces pieces = new NamePieces(); int dotpos = name.lastIndexOf('.'); int slashpos = name.lastIndexOf('/'); if (slashpos < 0 && dotpos < 0) { pieces.name = name; } else if (slashpos >= 0 && dotpos ...
Create a Java method that does the following: "Parse a name string into a namePieces object.".
Of course, here is the Java code you requested: ```java static public ParseResult parseDependencies(Node node, Set<String> dependentFeatures) { ParseResult result = new ParseResult(); for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor .getNext()) { Node defineDeps = null, requireDe...
Create a Java method that does the following: "Parses the dependencies of the given node.".
Of course, here is the Java code you requested: ```java public GVRAndroidResource addResource(GVRAndroidResource resource) { String fileName = resource.getResourcePath(); GVRAndroidResource resourceValue = resourceMap.get(fileName); if (resourceValue != null) { return re...
Create a Java method that does the following: "Add a GVRAndroidResource to the cache.".
Of course, here is the Java code you requested: ```java public static ShapeDrawable oval(@ColorInt int color) { if (sOval == null) { sOval = new OvalShape(); } ShapeDrawable d = new ShapeDrawable(sOval); d.setIntrinsicWidth(-1); d.setIntrinsicHeight(-1); d.ge...
Create a Java method that does the following: "Create an oval shape drawable.".
Of course, here is the Java code you requested: ```java public static boolean unlock(int innerId) { InterProcessMutex mutex = map.remove(innerId); if (mutex != null) { if (mutex.isAcquiredInThisProcess()) { try { mutex.release(); LOG.d...
Create a Java method that does the following: "Unlock an InterProcessMutex.".
Of course, here is the Java code you requested: ```java public void updateEntry(CmsUUID entryId, final AsyncCallback<Void> callback) { getChildren( entryId, CmsSitemapTreeItem.getItemById(entryId).isOpen(), new AsyncCallback<CmsClientSitemapEntry>() { publi...
Create a Java method that does the following: "Update the entry with the given id.".
Of course, here is the Java code you requested: ```java @Override @Path("/{solutionId}") @ApiOperation(value="Retrieve a solution or all solutions", notes="If {solutionId} is not present, returns all solutions.", response=Solution.class, responseContainer="List") public JSONObject get(Strin...
Create a Java method that does the following: "Retrieve a single resource.".
Of course, here is the Java code you requested: ```java @Override public ModifyReplicationSubnetGroupResult modifyReplicationSubnetGroup(ModifyReplicationSubnetGroupRequest request) { request = beforeClientExecution(request); return executeModifyReplicationSubnetGroup(request); } ``` Hope this...
Create a Java method that does the following: "Modify a replication subnet group.".
Of course, here is the Java code you requested: ```java public int update(Connection conn, String sql, Object param) throws SQLException { return this.update(conn, sql, new Object[] { param }); } ``` Hope this helps!
Create a Java method that does the following: "Update the record set with the given parameters.".
Of course, here is the Java code you requested: ```java public void readData(InputStream is, StatusUI statusUI) throws IOException, EOFException, DAP2Exception { /* ByteArrayOutputStream bout = new ByteArrayOutputStream(50 * 1000); copy(is, bout); LogStream.dbg.printf(" readData siz...
Create a Java method that does the following: "Reads a single IDENTITY from the specified input stream.".
Of course, here is the Java code you requested: ```java @Override public void run() { while (!stopProcessing.get()) { try { JawrWatchEvent evt = watchEvents.take(); AtomicBoolean processingBundle = bundlesHandler.isProcessingBundle(); synchronized (processingBundle) { // Wait until processing...
Create a Java method that does the following: "Run the processing thread.".
Of course, here is the Java code you requested: ```java private void required(String attributeName, Resource attributValue, boolean exists) throws ApplicationException { if (attributValue == null) throw new ApplicationException("invalid attribute constellation for the tag zip", "attribute [" + attributeName + "]...
Create a Java method that does the following: "required - attribute".
Of course, here is the Java code you requested: ```java public boolean isSameType( ImageType o ) { if( family != o.family ) return false; if( dataType != o.dataType) return false; if( numBands != o.numBands ) return false; return true; } ``` Hope this helps!
Create a Java method that does the following: "Returns true if this image type is the same as o.".
Of course, here is the Java code you requested: ```java public boolean supports(final String committeeReport,final String rm) { for (final ViewRiksdagenCommitteeBallotDecisionPoliticianSummary summary : ballotDecisions) { if (summary.getRm().equalsIgnoreCase(rm) && summary.getCommitteeReport().equalsIgnoreCase(co...
Create a Java method that does the following: "Checks if the given committeeReport and rm are supported by this view.".
Of course, here is the Java code you requested: ```java public KeyArea setupKey(int iKeyArea) { KeyArea keyArea = null; if (iKeyArea == DBConstants.MAIN_KEY_FIELD) { keyArea = this.makeIndex(DBConstants.UNIQUE, DBConstants.PRIMARY_KEY); keyArea.addKeyField(DBConstant...
Create a Java method that does the following: "Set up the Key area for this record.".
Of course, here is the Java code you requested: ```java public boolean parseNext(ByteBuffer buffer) { if (DEBUG) LOG.debug("parseNext s={} {}", _state, BufferUtils.toDetailString(buffer)); try { // Start a request/response if (_state == State.START) { ...
Create a Java method that does the following: "Parses the next HTTP response.".
Of course, here is the Java code you requested: ```java private void applyHtmlStyle(Element element, ShapeStyle style) { if (style.getFillColor() != null && !"".equals(style.getFillColor())) { Dom.setStyleAttribute(element, "fillColor", style.getFillColor()); } Dom.setStyleAttribute(element, "fillOpacity", Fl...
Create a Java method that does the following: "Apply the html style to the element".
Of course, here is the Java code you requested: ```java public Collection<String> getSelectedCities() { Set<String> cities = new TreeSet<String>(); for (JCheckBox checkBox : checkBoxes) { if (checkBox.isSelected()) { cities.add(checkBox.getText()); ...
Create a Java method that does the following: "Get the selected cities.".
Of course, here is the Java code you requested: ```java public static List<IIsotope> getIsotopes(IMolecularFormula formula, IElement element) { List<IIsotope> isotopeList = new ArrayList<IIsotope>(); for (IIsotope isotope : formula.isotopes()) { if (isotope.getSymbol().equals(element.getSy...
Create a Java method that does the following: "Gets the IIsotope list for a given element in a MolecularFormula.".
Of course, here is the Java code you requested: ```java public boolean next() { if (this.iter == null) { this.iter = new ArrayList<>(this.values).iterator(); } final boolean ret = this.iter.hasNext(); if (ret) { this.current = this.iter.next(); } ...
Create a Java method that does the following: "Get the next coding coding.".
Of course, here is the Java code you requested: ```java private <T> T invokeURL(String toBeInvoked, Class<T> returnType) throws SameAsServiceException { URL url; try { url = new URL(toBeInvoked); } catch (MalformedURLException e) { throw new SameAsServiceException("An er...
Create a Java method that does the following: "Invoke the URL with the given return type.".
Of course, here is the Java code you requested: ```java public List<T> list(String str) { Map<String,T> map = new LinkedHashMap<String,T>(); if(str == null || str.length() == 0) // Select all resources by default str = "%"; String[] tokens = str.split(","); for(String t...
Create a Java method that does the following: "List all the resource types in the string".
Of course, here is the Java code you requested: ```java public static com.liferay.commerce.model.CommerceShipmentItem addCommerceShipmentItem( com.liferay.commerce.model.CommerceShipmentItem commerceShipmentItem) { return getService().addCommerceShipmentItem(commerceShipmentItem); } ``` Hope this helps!
Create a Java method that does the following: "Adds the commerce shipment item to the database.".
Of course, here is the Java code you requested: ```java @Override public final boolean isCompatible(final Unit that) { final DerivedUnit unit = that.getDerivedUnit(); return equals(unit) || isReciprocalOf(unit); } ``` Hope this helps!
Create a Java method that does the following: "Checks if the given unit is compatible with this one.".
Of course, here is the Java code you requested: ```java Rule FilterFunction() { return Sequence( Sequence( "progid:", OneOrMore(FirstOf('.', Ident())) ), push(new FunctionNode(match())), FilterArgume...
Create a Java method that does the following: "Filter a function.".
Of course, here is the Java code you requested: ```java public static int skip(Iterator<?> iterator, int n) { Parameters.checkCondition(n >= 0); int skipped = 0; while (skipped < n && iterator.hasNext()) { iterator.next(); skipped++; } return skipped; } ``` Hope this helps!
Create a Java method that does the following: "Skips n elements from the iterator.".
Of course, here is the Java code you requested: ```java public static List<Geometry> featureCollectionToGeometriesList( SimpleFeatureCollection collection, boolean doSubGeoms, String userDataField ) { List<Geometry> geometriesList = new ArrayList<Geometry>(); if (collection == null) { ...
Create a Java method that does the following: "This method is used to convert a feature collection to a list of geometries.".
Of course, here is the Java code you requested: ```java private ScopeBlock findSynchronizedScopeBlock(ScopeBlock sb, int monitorEnterPC) { ScopeBlock monitorBlock = sb; if (sb.hasChildren()) { for (ScopeBlock child : sb.getChildren()) { if (child.isSync() && (child.getStar...
Create a Java method that does the following: "Find synchronized scope block.".
Of course, here is the Java code you requested: ```java public Item process(Context context, CachingOptions cachingOptions, Item item) throws ItemProcessingException { String descriptorUrl = item.getDescriptorUrl(); Document descriptorDom = item.getDescriptorDom(); if (descriptorDom != null) {...
Create a Java method that does the following: "Process the item.".
Of course, here is the Java code you requested: ```java public void marshall(BatchDeleteImageRequest batchDeleteImageRequest, ProtocolMarshaller protocolMarshaller) { if (batchDeleteImageRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
Create a Java method that does the following: "marshalls the given BatchDeleteImageRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public static EthiopianTime ofNight( int hour, int minute, int second ) { return EthiopianTime.of(true, hour, minute, second); } ``` Hope this helps!
Create a Java method that does the following: "Gets the EthiopianTime from the Night - Time fields.".
Of course, here is the Java code you requested: ```java private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) { TypeInfo typeInfo = typeMaps.get(path); if (typeInfo == null) { typeInfo = new TypeInfo(superType); typeMaps.put(path, typeInfo); } ...
Create a Java method that does the following: "Get the TypeInfo object for a type.".
Of course, here is the Java code you requested: ```java public void onApplicationEvent(ApplicationEvent event) { // All events we care about are subtypes of ClientSecurityEvent if( event instanceof ClientSecurityEvent ) { Authentication authentication = (Authentication) event.getSource(); ...
Create a Java method that does the following: "Dispatches the event to all the registered listeners.".
Of course, here is the Java code you requested: ```java protected <R, C> R accept(AstVisitor<R, C> visitor, C context) { return visitor.visitNode(this, context); } ``` Hope this helps!
Create a Java method that does the following: "Visits this node then passes the given visitor to the appropriate method.".
Of course, here is the Java code you requested: ```java @GET public Response getStatus() { String uri = getUriInfo().getRequestUri().toString(); uri = (uri.endsWith("/") ? uri : uri + "/") + "ui"; final Response redirect = Response.status(Status.FOUND).location(java.net.URI.create(uri))...
Create a Java method that does the following: "Returns the status of the request.".
Of course, here is the Java code you requested: ```java public void marshall(UntagResourceRequest untagResourceRequest, ProtocolMarshaller protocolMarshaller) { if (untagResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "marshalls the given UNTAGResourceRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public static StorageExtendedErrorInformation getExtendedErrorInformation(final InputStream stream) throws SAXException, IOException, ParserConfigurationException { SAXParser saxParser = Utility.getSAXParser(); StorageErrorHandler hand...
Create a Java method that does the following: "Get the extended error information from an input stream.".
Of course, here is the Java code you requested: ```java public Sql getSQLByNameWithParameters(String name, Object parameters) { if (name == null) { return null; } Map<String, Object> parameterMap = buildParameters(parameters); SqlObject sqlObj = this.sqlMap.get(name); if (sqlObj != null) { ...
Create a Java method that does the following: "Gets the SQL with the specified name and parameters.".
Of course, here is the Java code you requested: ```java public static String getFullName(String baseName, String localeName) { if (baseName == null || baseName.length() == 0) { if (localeName.length() == 0) { return localeName = ULocale.getDefault().toString(); } ...
Create a Java method that does the following: "Gets the full name of a resource.".
Of course, here is the Java code you requested: ```java public Observable<List<DomainTopicInner>> listByDomainAsync(String resourceGroupName, String domainName) { return listByDomainWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1<ServiceResponse<List<DomainTopicInner>>, List<DomainTopicIn...
Create a Java method that does the following: "Gets a list of a domain topic.".
Of course, here is the Java code you requested: ```java private static boolean checkAbbreviationHighlight(IAtomContainer container, Sgroup sgroup) { assert sgroup.getType() == SgroupType.CtabAbbreviation; Set<IAtom> sgroupAtoms = sgroup.getAtoms(); int atomHighlight = 0; int bondHighli...
Create a Java method that does the following: "Check if the abbreviation highlighting is true.".