Questo contenuto non è disponibile nella lingua selezionata.

4. Setting Method Variables to String


Some types of information have a integer value within the database but the information given in the API has a string value. This is common for search filters which depend on a category; the category has a user-friendly string name and an internal integer.
Attempting to pass the string value when the server expects an integer causes the operation to fail with an error that it cannot find the method.
rhqadmin@localhost:7080$ groupcriteria = new ResourceGroupCriteria();
rhqadmin@localhost:7080$ groupcriteria.addFilterGroupCategory('MIXED')
Can't find method org.rhq.core.domain.criteria.ResourceGroupCriteria.addFilterGroupCategory(string). (<Unknown source>#1)
To use the user-friendly string in script, append the .toString method with the remote API method.
groupcriteria.addFilterGroupCategory.toString('MIXED');
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima