How to get class and use method on it

Hi,
class State {
        String name
        Enum expectedValue
        public State(String name,Enum expectedValue){
            this.name = name;
            this.expectedValue = expectedValue;
In the same class I need to have a method that takes a String and it should return matching
Enum value. Since  class already have the expectedValue my idea is to get the Enum class ( using that if possible) and
the call get() on it see my example below;
Example:
expectedValue is HwState.UPGRADED;
    public HwState convertActualToStateType( String actual){
        return  HwState.get(Integer.valueOf(actual));
How can I get the Enum class (HwState) ? And then use it e.g. HwState.get() ?
//mike

Oracle is not allowing to Pesonlize the Buttons.

Similar Messages

  • Re: How do you create and use "common" type classes?

    Hi,
    You have 2 potential solutions in your case :
    1- Sub-class TextNullable class of Framework and add your methods in the
    sub-class.
    This is the way Domain class work. Only Nullable classes are sub-classable.
    This is usefull for Data Dictionary.
    The code will be located in any partition that uses or references the supplier
    plan.
    2- Put your add on code on a specific class and instanciate it in your user
    classes (client or server).
    You could also use interface for a better conception if needed. The code will
    also be in any partition that uses or references the supplier plan where your
    add on class is located.
    If you don't want that code to be on each partition, you could use libraries :
    configure as library the utility plan where is your add-on class.
    You can find an example of the second case (using a QuickSort class,
    GenericArray add-on) with the "QuickSort & List" sample on my personal site
    http://perso.club-internet.fr/dnguyen/
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    http://perso.club-internet.fr/dnguyen/
    Robinson, Richard a écrit:
    I'm relatively new to forte and I'd like to know how can you handle utility
    type classes that you want to use through out your application? Ideally
    what I want is a static class with static methods.
    Let's say that I have a StringUtil class that has a bunch of methods for
    manipulating strings.
    My problem is that we have code that runs on the client and code that runs
    on the server. Both areas could use the StringUtil class, but from what I
    understand, I have to create StringUtil in a plan and then create a server
    object of type StringUtil. The server object will eventually get assigned
    to a partition. That's not good since I really want the server object to
    physically reside at the server end and at the client end. (Actually, I
    don't want a server object, I just want to invoke a static method of a
    static class).
    Any clues on how to solve this problem would be appreciated.
    Also, what is the url at Sage-it that has a summary of all emails that have
    been posted to [email protected]? Perhaps this question has been
    answered previously.
    Thanks in advance
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Richard,
    Your question about "utility classes" brings up a number of issues, all of
    which are important to long-term success with Forte.
    There is no such thing as a static method (method that is associated with a
    class but without an implicit object reference - this/self/me "pointer") in
    TOOL, nor is there such thing as a global method (method not associated
    with a class at all). This is in contrast to C++, which has both, and
    Java, which has static methods, but not global classes. Frequently, Forte
    developers will write code like this:
    result, num : double;
    // get initial value for num....
    tmpDoubleData : DoubleData = new;
    tmpDoubleData.DoubleValue = num;
    result = tmpDoubleData.Sqrt().DoubleValue;
    tmpDoubleData = NIL; // send a hint to the garbage collector
    in places where a C++ programmer would write:
    double result, num;
    // get initial value for num....
    result = Math::Sqrt(num);
    or a Java programmer would write:
    double result, num;
    // get initial value for num....
    result = Math.sqrt(num);
    The result of this is that you end up allocating an extra object now and
    then. In practice, this is not a big deal memory-wise. If you have a
    server that is getting a lot of hits, or if you are doing some intense
    processing, then you could pre-allocate and reuse the data object. Note
    that optimization has its own issues, so you should start by allocating
    only when you need the object.
    If you are looking for a StringUtil class, then you will want to use an
    instance of TextData or TextNullable. If you are looking to add methods,
    you could subclass from TextNullable, and add methods. Note that you will
    still have to instantiate an object and call methods on that object.
    The next issue you raise is where the object resides. As long as you do
    not have an anchored object, you will always have a copy of an object on a
    partition. If you do not pass the object in a call to another partition,
    the object never leaves. If you pass the object to another partition, then
    the other partition will have its own copy of the object. This means that
    the client and the server will have their own copies, which is the effect
    you are looking for.
    Some developers new to Forte will try to get around the lack of global
    methods in TOOL by creating a user-visible service object and then calling
    methods on it. If you have a general utility, like string handling, this
    is a bad idea, since a service object can reside only on a single
    partition.
    Summary:
    * You may find everything you want in TextData.
    * Unless you anchor the object, the instance will reside where you
    intuitively expect it.
    * To patch over the lack of static methods in TOOL, simply allocate an
    instance when required.
    Feel free to email me if you have more questions on this.
    At the bottom of each message that goes through the mailing list server,
    the address for the list archive is printed:
    http://pinehurst.sageit.com/listarchive/.
    Good Luck,
    CSB
    -----Original Message-----
    From: Robinson, Richard
    Sent: Tuesday, March 02, 1999 5:44 PM
    To: '[email protected]'
    Subject: How do you create and use "common" type classes?
    I'm relatively new to forte and I'd like to know how can you handle utility
    type classes that you want to use through out your application? Ideally
    what I want is a static class with static methods.
    Let's say that I have a StringUtil class that has a bunch of methods for
    manipulating strings.
    My problem is that we have code that runs on the client and code that runs
    on the server. Both areas could use the StringUtil class, but from what I
    understand, I have to create StringUtil in a plan and then create a server
    object of type StringUtil. The server object will eventually get assigned
    to a partition. That's not good since I really want the server object to
    physically reside at the server end and at the client end. (Actually, I
    don't want a server object, I just want to invoke a static method of a
    static class).
    Any clues on how to solve this problem would be appreciated.
    Also, what is the url at Sage-it that has a summary of all emails that have
    been posted to [email protected]? Perhaps this question has been
    answered previously.
    Thanks in advance

  • How to implement classes and methods in badi's ?

    how to implement classes and methods in badi's? and where i have to write the code based on the requirement?can anyone explain me briefly?

    Hi
    Every BADI by default Implements an INTERFACE which already contains some methods with parameters.
    So you have to find the relavenet method based on the related paramters (by checking the fields in that paramters) you have to double click on the method and to write the code.
    see the doc
    DEFINING THE BADI
    1) execute Tcode SE18.
    2) Specify a definition Name : ZBADI_SPFLI
    3) Press create
    4) Choose the attribute tab. Specify short desc for badi.. and specify the type :
    multiple use.
    5) Choose the interface tab
    6) Specify interface name: ZIF_EX_BADI_SPFLI and save.
    7) Dbl clk on interface name to start class builder . specify a method name (name,
    level, desc).
    Method level desc
    Linese;ection instance methos some desc
    8) place the cursor on the method name desc its parameters to define the interface.
    Parameter type refe field desc
    I_carrid import spfli-carrid some
    I_connid import spefi-connid some
    9) save , check and activate…adapter class proposed by system is
    ZCL_IM_IM_LINESEL is genereated.
    IMPLEMENTATION OF BADI DEFINITION
    1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.
    2) Specify aname for implementation ZIM_LINESEL
    3) Specify short desc.
    4) Choose interface tab. System proposes a name fo the implementation class.
    ZCL_IM_IMLINESEL which is already generarted.
    5) Specify short desc for method
    6) Dbl clk on method to insert code..(check the code in “AAA”).
    7) Save , check and activate the code.
    Some useful URL
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    Now write a sample program to use this badi method..
    Look for “BBB” sample program.
    “AAA”
    data : wa_flights type sflight,
    it_flights type table of sflight.
    format color col_heading.
    write:/ 'Flight info of:', i_carrid, i_connid.
    format color col_normal.
    select * from sflight
    into corresponding fields of table it_flights
    where carrid = i_carrid
    and connid = i_connid.
    loop at it_flights into wa_flights.
    write:/ wa_flights-fldate,
    wa_flights-planetype,
    wa_flights-price currency wa_flights-currency,
    wa_flights-seatsmax,
    wa_flights-seatsocc.
    endloop.
    “BBB”
    *& Report ZBADI_TEST *
    REPORT ZBADI_TEST .
    tables: spfli.
    data: wa_spfli type spfli,
    it_spfli type table of spfli with key carrid connid.
    *Initialise the object of the interface.
    data: exit_ref type ref to ZCL_IM_IM_LINESEL,
    exit_ref1 type ref to ZIF_EX_BADISPFLI1.
    selection-screen begin of block b1.
    select-options: s_carr for spfli-carrid.
    selection-screen end of block b1.
    start-of-selection.
    select * from spfli into corresponding fields of table it_spfli
    where carrid in s_carr.
    end-of-selection.
    loop at it_spfli into wa_spfli.
    write:/ wa_spfli-carrid,
    wa_spfli-connid,
    wa_spfli-cityfrom,
    wa_spfli-deptime,
    wa_spfli-arrtime.
    hide: wa_spfli-carrid, wa_spfli-connid.
    endloop.
    at line-selection.
    check not wa_spfli-carrid is initial.
    create object exit_ref.
    exit_ref1 = exit_ref.
    call method exit_ref1->lineselection
    EXPORTING
    i_carrid = wa_spfli-carrid
    i_connid = wa_spfli-connid.
    clear wa_spfli.
    Reward points for useful Answers
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • How to get iccid by using imei?i had lost my iphone and i want to find it back.

    how to get iccid by using imei?i had lost my iphone and i want to find it back.

    Ocean20 wrote:
    Not sure about ICCID but you can get your IMEI by going to the computer you normally sync to and open iTunes there click on edit then preferences then on the devices tab and then hover mouse over your backup and the IMEI and other info on your phone will appear
    Interesting. Yet another of the many Easter eggs dispersed throughout the system.

  • My laptop has been stolen (the Baterds) now is wndows protected by password but if they get inside and use firefox with sync the can come a long way. how can i stop that from happening. can I block that laptop from syncing? thx Rick

    my laptop has been stolen (the Batserds) now is windows protected by password but if they get inside and use firefox with sync they could come a long way. How can i stop that from happening. Can I block that laptop from syncing? thx Rick

    * https://support.mozilla.com/kb/ive-lost-my-phone-how-do-i-deactivate-sync

  • How to get instrument and plug in files to logic8?

    How to get instrument and plug in files to logic8?
    I lost mine in a hard drive crash.
    I cant use my DVD jam pack
    This is my spec
      Modellnamn:          iMac
      Modellidentifierare:          iMac8,1
      Processornamn:          Intel Core 2 Duo
      Processorhastighet:          2,4 GHz
      Antal processorer:          1
      Totalt antal kärnor:          2
      L2-cache:          6 MB
      Minne:          3 GB
      Busshastighet:          1,07 GHz
      Boot ROM-version:          IM81.00C1.B00
      SMC-version (system):          1.29f1
    iMac, OS X Mountain Lion (10.8.2)

    I think you want to get the latitude and longitude information of client accessing the web application. In the web application you cannot directly get the client location information as the nature of the web application is different from windows applications.
    I advise you to develop a Silverlight component and in that Silverlight component use geolocation classes to get client location. Please refer this article for getting data in Silverlight http://www.c-sharpcorner.com/UploadFile/82b980/getting-geo-location-of-user-in-silverlight/
    And once you get the location information you can send that data back to ASP.net webpage or call any javascript method as shown here http://ovaismehboob.wordpress.com/2013/06/22/bridging-data-between-asp-net-and-silverlight/
    Hope this helps!
    Ovais Mehboob Ahmed Khan http://ovaismehboob.wordpress.com

  • How to set-up and use FAMILY Sharing

    Can someone please explain to me in detail how to set-up and use FAMILY Sharing, none of the information I have so far found in the documentation helps at all, in fact it puts you in a constant loop giving the same information over and over again
    We have quite a few devices from ipads, iphones and ipods and I need to set-up Family Sharing.
    We have our main Apple ID which is linked to our Payment method, I have now got my son a new iPad, I have created his Apple ID and set-up a link via FAMILY Sharing to our main Apple ID.
    From what I read we should be able to share our purchased Apps between family members.
    So I figured I would be able to get the Apps now via iTunes that are part of the FAMILY Sharing, however when I go into ITunes (latest version downloaded yesterday) I can only see the Home sharing menu item not FAMILY Sharing, so I cannot work out in Itunes how to get Apps that are FAMILY shared.  So ok I will try and get Apps directly via the Ipad using the App Store.  To test it is working I look for a known paid for App, I then go to download it and it is now asking me to pay for it again. 
    Can someone please explain to me in detail how FAMILY Sharing is supposed to work and how I get it to work please.
    Thanks for your help
    Greg

    Hey GregWr,
    Thanks for the question. The following resources provides some of the best information regarding Family Sharing. Included, you’ll find information on making sure the accounts are set to "Share my purchases”, as well as information on downloading Family Member purchases from the iTunes Purchased section. Please note that some applications are not shareable.
    Sharing purchased content with Family Sharing - Apple Support
    http://support.apple.com/en-us/HT201085
    Which purchased content can I share using Family Sharing - Apple Support
    http://support.apple.com/en-us/HT203046
    If you don't see your family's shared content - Apple Support
    http://support.apple.com/en-us/HT201454
    Thanks,
    Matt M.

  • How to get Max and Min value entered in a DOS console?

    Hi there? I wanted to get the Maximum and Minimum value that I entered in a console and displays it. This is using the java.lang.Math class and using it's method max and main. please help. thanks - new to java

    Sounds like you need very basic advice: Start with the tutorials: http://java.sun.com/docs/books/tutorial/index.html
    And if the algorithm is the problem:
    - Make two variables that hold the current maximum and minimum value
    - whenever a value is entered, compare it with the minimum, if it is smaller, set the minimum to that value
    - ditto with maximum
    at the end the two variables contain the maximum and minimum values.

  • How to get multiple records using fn-bea:execute-sql()

    Hi,
    I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
    Regards,
    Nagaraju
    Edited by: user10373980 on Sep 29, 2008 6:11 AM

    Hi,
    Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
    For example:
    fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
    Id Name
    01 XXX
    02 YYY
    03 ZZZ
    I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
    <student>
    <Name>XXX</Name>
    </student>
    I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
    Please suggest.
    regards,
    Venkat

  • How to get gui_download and gui_upload with popup filename?

    how to get gui_download and gui_upload with popup filename?

    Here is a short example.
    report zrich_0003 .
    data: ifiletab type filetable.
    data: xfiletab like line of ifiletab.
    data: xstring type string.
    data: rc type i.
    data: itab type table of string.
    data: xtab type string.
    start-of-selection.
      call method cl_gui_frontend_services=>file_open_dialog
        changing
          file_table              = ifiletab
          rc                      = rc.
      read table ifiletab into xfiletab index 1.
      xstring = xfiletab-filename.
      check not xstring is initial.
      call method cl_gui_frontend_services=>gui_upload
        exporting
          filename                = xstring
      changing
        data_tab                = itab.
      loop at itab into xtab.
        write:/ xtab.
      endloop.
    Regards,
    Rich Heilman

  • How to get nodes and its attributes of an XML file usiong DOM parsing?

    how to get nodes and its attributes of an XML file usiong DOM parsing?
    i am new to XML parsing.......
    Thanking you........

    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;      ...
    //Setup the document
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
         Document doc = docBuilder.parse (new File("MY_XML_FILE.xml"));
    //get elemets by name
         String elementValue = doc.getElementsByTagName("MY_ELEMENT").item(0).getTextContent();
    //This method can return multiple nodes, in this instance I get item(0) , first nodeRead the api for other methods of getting data.

  • How to get the workcentres used in the routing out of 2 alternate routings

    Dear All,
    I would like to know how to get the workcentres used in the routing out of 2 alternate routings.
    I referred PLKO got the Task List Type (PLNTY), Group(PLNNR), Group Counter(PLNAL), Plant(werks).
    I passed this in to PLPO, The problem in PLPO is we don’t have the distinguishing field Group Counter(PLNAL), so I am getting all the ARBID including both alternates.
    How to get the ARBID with respect to Groupcounter 1 alone.
    If a get the ARBID , I can get the ARBPL from CRHD.

    HI,
    Use PLAS Table also.  you have to use PLKO> PLAS> PLPO.
    Pass PLNNR & PLNAL in PLAS and get PLNNR & PLNKN.
    Then pass these into PLPO.
    work centers from CRHD
    Regards,
    Krishna Mohan
    Edited by: Krishna Mohan N on Jan 31, 2008 12:28 PM

  • How to get vendor and company code based on logistic invoice document

    how to get vendor and company code based on logistic invoice document in abap/4?

    Hello Kumar
    When you call BAPI_INCOMINGINVOICE_GETDETAIL using
    INVOICENUMBER = <number of invoice>
    FISCALYEAR = <fiscal year>
    the returned HEADERDATA contains what you are looking for:
    HEADERDATA-COMP_CODE
    HEADERDATA-DIFF_INF
    Regards
      Uwe

  • Does my macbook air have a built in virus scan?  how can I access and use it? also any recommendations of what software if this is not avail ?

    does my macbook air have a built in virus scan?  how can I access and use it? also any recommendations of what software if this is not avail ?

    Contrary to what Geeks on Hugs is telling you, Mac OS X does indeed have a basic malware scanner. It is not a feature that is directly accessible to the user, and works a bit differently than every other malware scanner out there. Gatekeeper, which has been mentioned here, is entirely separate, and provides a different method for helping to protect you against malware.
    The anti-malware scanner in Mac OS X is called XProtect. When you download an application (or any other kind of executable code), it is automatically "quarantined," so that when you open it you're asked if you really want to do that. I'm sure you're very familiar with this aspect of Mac OS X if you have ever downloaded any apps from outside the App Store. What you don't know, though, is that each time you try to open a new app, that app is checked by XProtect. If it is identified as malware, you will not be allowed to open it, and will be warned that it's malware.
    At this time, there is no known malware that can infect a properly up-to-date Mac. All current malware will be blocked by one or more methods.
    For more information, see my Mac Malware Guide.
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com.)

  • I have entered a incorrect email address, so cannot update an app I purchased. The email does not exist. How do I delete and use my primary Apple ID

    I have used an incorrect email address for my Apple ID  when I punched an App. Cannot get updates. How do I delete and use my primary account email address?

    Delete and redownload that application when signed into the correct Apple ID. This may require repurchasing it.
    (127051)

Maybe you are looking for