Android Open Source - SalesOrder Contact






From Project

Back to project page SalesOrder.

License

The source code is released under:

GNU General Public License

If you think the Android project SalesOrder listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes;
/*//from  w  w  w.  j  a va 2  s.com

 Auto-Generated by SAP NetWeaver Gateway Productivity Accelerator, Version 1.1.1

*/
import java.net.MalformedURLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sap.gwpa.proxy.BaseEntityType;
import com.sap.gwpa.proxy.ODataQuery;
import com.sap.gwpa.proxy.TypeConverter;
import com.sap.mobile.lib.parser.IODataEntry;
import com.sap.mobile.lib.parser.IODataProperty;
import com.sap.mobile.lib.parser.IODataSchema;
import com.sap.mobile.lib.parser.IODataServiceDocument;
import com.sap.mobile.lib.parser.IParser;
import com.sap.mobile.lib.parser.ODataEntry;

/**
 * Contact Entity Type 
 *
 * <br>key (BusinessPartnerID, Title, FirstName, MiddleName, LastName, PostalCode, City, Street, Building, Country, AddressType)
 */
public class Contact extends BaseEntityType 
{
  // Contact properties
    private String BusinessPartnerID;
    private String Title;
    private String FirstName;
    private String MiddleName;
    private String LastName;
    private String Nickname;
    private String Initials;
    private String Sex;
    private String PhoneNumber;
    private String FaxNumber;
    private String EmailAddress;
    private String Language;
    private String PostalCode;
    private String City;
    private String Street;
    private String Building;
    private String Country;
    private String AddressType;
    private Date AddressValStartDate;
    private Date AddressValEndDate;

  // reference to the parser
  private IParser parser;
  // reference to the schema
  private IODataSchema schema;

  private DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");


  private static Map<String, String> contactLabels;

  private static Map<String, String> contactTypes;  
  
  /**
   * Constructor
   * @param entry
   * @throws MalformedURLException
   */
  public Contact(final IODataEntry entry, IParser parser, IODataSchema schema) throws MalformedURLException
  {
    super(entry);
    this.BusinessPartnerID =  TypeConverter.getAsString(entry.getPropertyValue("BusinessPartnerID"));
    this.Title =  TypeConverter.getAsString(entry.getPropertyValue("Title"));
    this.FirstName =  TypeConverter.getAsString(entry.getPropertyValue("FirstName"));
    this.MiddleName =  TypeConverter.getAsString(entry.getPropertyValue("MiddleName"));
    this.LastName =  TypeConverter.getAsString(entry.getPropertyValue("LastName"));
    this.Nickname =  TypeConverter.getAsString(entry.getPropertyValue("Nickname"));
    this.Initials =  TypeConverter.getAsString(entry.getPropertyValue("Initials"));
    this.Sex =  TypeConverter.getAsString(entry.getPropertyValue("Sex"));
    this.PhoneNumber =  TypeConverter.getAsString(entry.getPropertyValue("PhoneNumber"));
    this.FaxNumber =  TypeConverter.getAsString(entry.getPropertyValue("FaxNumber"));
    this.EmailAddress =  TypeConverter.getAsString(entry.getPropertyValue("EmailAddress"));
    this.Language =  TypeConverter.getAsString(entry.getPropertyValue("Language"));
    this.PostalCode =  TypeConverter.getAsString(entry.getPropertyValue("PostalCode"));
    this.City =  TypeConverter.getAsString(entry.getPropertyValue("City"));
    this.Street =  TypeConverter.getAsString(entry.getPropertyValue("Street"));
    this.Building =  TypeConverter.getAsString(entry.getPropertyValue("Building"));
    this.Country =  TypeConverter.getAsString(entry.getPropertyValue("Country"));
    this.AddressType =  TypeConverter.getAsString(entry.getPropertyValue("AddressType"));
    this.AddressValStartDate =  TypeConverter.getAsDate(entry.getPropertyValue("AddressValStartDate"));
    this.AddressValEndDate =  TypeConverter.getAsDate(entry.getPropertyValue("AddressValEndDate"));
      this.parser = parser;
        this.schema = schema;
   }
  
  /**
   * Contact Constructor</br>
   * Dummy values may apply
   *
   */
  public Contact( String BusinessPartnerID, String Title, String FirstName, String MiddleName, String LastName, String PostalCode, String City, String Street, String Building, String Country, String AddressType) 
  {
    super(new ODataEntry());
    
        this.setBusinessPartnerID(BusinessPartnerID);
        this.setTitle(Title);
        this.setFirstName(FirstName);
        this.setMiddleName(MiddleName);
        this.setLastName(LastName);
        this.setPostalCode(PostalCode);
        this.setCity(City);
        this.setStreet(Street);
        this.setBuilding(Building);
        this.setCountry(Country);
        this.setAddressType(AddressType);
  }



  // Contact properties getters and setters
    
  /**
   * @return - String Bus. Part. ID
   */
  public String getBusinessPartnerID()
  {
    return this.BusinessPartnerID;
  }
  
  /**
   * @param BusinessPartnerID - Bus. Part. ID
   */
  public void setBusinessPartnerID(String BusinessPartnerID)
  {
    this.BusinessPartnerID = BusinessPartnerID;
    
    getEntry().putPropertyValue("BusinessPartnerID", BusinessPartnerID);
  }
    
  /**
   * @return - String Title
   */
  public String getTitle()
  {
    return this.Title;
  }
  
  /**
   * @param Title - Title
   */
  public void setTitle(String Title)
  {
    this.Title = Title;
    
    getEntry().putPropertyValue("Title", Title);
  }
    
  /**
   * @return - String First Name
   */
  public String getFirstName()
  {
    return this.FirstName;
  }
  
  /**
   * @param FirstName - First Name
   */
  public void setFirstName(String FirstName)
  {
    this.FirstName = FirstName;
    
    getEntry().putPropertyValue("FirstName", FirstName);
  }
    
  /**
   * @return - String Middle Name
   */
  public String getMiddleName()
  {
    return this.MiddleName;
  }
  
  /**
   * @param MiddleName - Middle Name
   */
  public void setMiddleName(String MiddleName)
  {
    this.MiddleName = MiddleName;
    
    getEntry().putPropertyValue("MiddleName", MiddleName);
  }
    
  /**
   * @return - String Last Name
   */
  public String getLastName()
  {
    return this.LastName;
  }
  
  /**
   * @param LastName - Last Name
   */
  public void setLastName(String LastName)
  {
    this.LastName = LastName;
    
    getEntry().putPropertyValue("LastName", LastName);
  }
    
  /**
   * @return - String Nickname
   */
  public String getNickname()
  {
    return this.Nickname;
  }
  
  /**
   * @param Nickname - Nickname
   */
  public void setNickname(String Nickname)
  {
    this.Nickname = Nickname;
    
    getEntry().putPropertyValue("Nickname", Nickname);
  }
    
  /**
   * @return - String Initials
   */
  public String getInitials()
  {
    return this.Initials;
  }
  
  /**
   * @param Initials - Initials
   */
  public void setInitials(String Initials)
  {
    this.Initials = Initials;
    
    getEntry().putPropertyValue("Initials", Initials);
  }
    
  /**
   * @return - String Sex
   */
  public String getSex()
  {
    return this.Sex;
  }
  
  /**
   * @param Sex - Sex
   */
  public void setSex(String Sex)
  {
    this.Sex = Sex;
    
    getEntry().putPropertyValue("Sex", Sex);
  }
    
  /**
   * @return - String Phone No.
   */
  public String getPhoneNumber()
  {
    return this.PhoneNumber;
  }
  
  /**
   * @param PhoneNumber - Phone No.
   */
  public void setPhoneNumber(String PhoneNumber)
  {
    this.PhoneNumber = PhoneNumber;
    
    getEntry().putPropertyValue("PhoneNumber", PhoneNumber);
  }
    
  /**
   * @return - String Phone No.
   */
  public String getFaxNumber()
  {
    return this.FaxNumber;
  }
  
  /**
   * @param FaxNumber - Phone No.
   */
  public void setFaxNumber(String FaxNumber)
  {
    this.FaxNumber = FaxNumber;
    
    getEntry().putPropertyValue("FaxNumber", FaxNumber);
  }
    
  /**
   * @return - String E-Mail Address
   */
  public String getEmailAddress()
  {
    return this.EmailAddress;
  }
  
  /**
   * @param EmailAddress - E-Mail Address
   */
  public void setEmailAddress(String EmailAddress)
  {
    this.EmailAddress = EmailAddress;
    
    getEntry().putPropertyValue("EmailAddress", EmailAddress);
  }
    
  /**
   * @return - String Language
   */
  public String getLanguage()
  {
    return this.Language;
  }
  
  /**
   * @param Language - Language
   */
  public void setLanguage(String Language)
  {
    this.Language = Language;
    
    getEntry().putPropertyValue("Language", Language);
  }
    
  /**
   * @return - String Postal Code
   */
  public String getPostalCode()
  {
    return this.PostalCode;
  }
  
  /**
   * @param PostalCode - Postal Code
   */
  public void setPostalCode(String PostalCode)
  {
    this.PostalCode = PostalCode;
    
    getEntry().putPropertyValue("PostalCode", PostalCode);
  }
    
  /**
   * @return - String City
   */
  public String getCity()
  {
    return this.City;
  }
  
  /**
   * @param City - City
   */
  public void setCity(String City)
  {
    this.City = City;
    
    getEntry().putPropertyValue("City", City);
  }
    
  /**
   * @return - String Street
   */
  public String getStreet()
  {
    return this.Street;
  }
  
  /**
   * @param Street - Street
   */
  public void setStreet(String Street)
  {
    this.Street = Street;
    
    getEntry().putPropertyValue("Street", Street);
  }
    
  /**
   * @return - String Building
   */
  public String getBuilding()
  {
    return this.Building;
  }
  
  /**
   * @param Building - Building
   */
  public void setBuilding(String Building)
  {
    this.Building = Building;
    
    getEntry().putPropertyValue("Building", Building);
  }
    
  /**
   * @return - String Country
   */
  public String getCountry()
  {
    return this.Country;
  }
  
  /**
   * @param Country - Country
   */
  public void setCountry(String Country)
  {
    this.Country = Country;
    
    getEntry().putPropertyValue("Country", Country);
  }
    
  /**
   * @return - String Address Type
   */
  public String getAddressType()
  {
    return this.AddressType;
  }
  
  /**
   * @param AddressType - Address Type
   */
  public void setAddressType(String AddressType)
  {
    this.AddressType = AddressType;
    
    getEntry().putPropertyValue("AddressType", AddressType);
  }
    
  /**
   * @return - Date Time Stamp
   */
  public Date getAddressValStartDate()
  {
    return this.AddressValStartDate;
  }
  
  /**
   * @param AddressValStartDate - Time Stamp
   */
  public void setAddressValStartDate(Date AddressValStartDate)
  {
    this.AddressValStartDate = AddressValStartDate;
    
    getEntry().putPropertyValue("AddressValStartDate", dateFormat.format(AddressValStartDate));
  }
    
  /**
   * @return - Date Time Stamp
   */
  public Date getAddressValEndDate()
  {
    return this.AddressValEndDate;
  }
  
  /**
   * @param AddressValEndDate - Time Stamp
   */
  public void setAddressValEndDate(Date AddressValEndDate)
  {
    this.AddressValEndDate = AddressValEndDate;
    
    getEntry().putPropertyValue("AddressValEndDate", dateFormat.format(AddressValEndDate));
  }
  
  /**
   * @return - representation of the Entity Type object in OData4SAP format
   */
  public String getStringPayload()  
  {
    String xml = null;
    
    xml = getEntry().toXMLString();
      
    return xml;
  }
  
  /**
   * @return - self ODataQuery object
   * @throws MalformedURLException 
   */
  public ODataQuery getEntityQuery() throws MalformedURLException  
  {
    return new ODataQuery(getEntry().getSelfLink().getUrl());
  }
  
  /**
   * @return - the date format.
   */
  public DateFormat getDateFormat()
  {
    return this.dateFormat;
  }


  /**
    * Static method that loads all of the entity type property labels. 
    * This method is called when the service class is initialized.
    * @param service Service document object containing all of the entity type properties.
     */  
    public static void loadLabels(IODataServiceDocument service)
    {
      List<IODataProperty> properties = getSchemaPropertiesFromCollection(service, "ContactCollection" );
        
      contactLabels = new HashMap<String, String>();
      contactTypes = new HashMap<String, String>();
      
      if (properties != null)
      {
          for (IODataProperty property : properties) 
          {
            contactLabels.put(property.getName(), property.getLabel());
            contactTypes.put(property.getName(), property.getType());
      }
      }
    }
    
    
    /**
    * Static method that returns the type for a given property name.
    * @param propertyName Property name.
    * @return Property label.
     */
    public static String getTypeForProperty(String propertyName)
    {
        return getLabelFromDictionary(contactTypes, propertyName);
    }
    
    
    /**
    * Static method that returns the label for a given property name.
    * @param propertyName Property name.
    * @return Property label.
     */
    public static String getLabelForProperty(String propertyName)
    {
        return getLabelFromDictionary(contactLabels, propertyName);
    }
}




Java Source Code List

com.capgemini.SalesOrder.LoginActivity.java
com.capgemini.SalesOrder.Page1ListActivity.java
com.capgemini.SalesOrder.Page1ListAdapter.java
com.capgemini.SalesOrder.Page2ListActivity.java
com.capgemini.SalesOrder.Page2ListAdapter.java
com.capgemini.SalesOrder.Page3ListActivity.java
com.capgemini.SalesOrder.Page3ListAdapter.java
com.capgemini.SalesOrder.Page4DetailsActivity.java
com.capgemini.SalesOrder.Page4DetailsAdapter.java
com.capgemini.SalesOrder.Page5DetailsActivity.java
com.capgemini.SalesOrder.Page5DetailsAdapter.java
com.capgemini.SalesOrder.Page6DetailsActivity.java
com.capgemini.SalesOrder.Page6DetailsAdapter.java
com.capgemini.SalesOrder.SplashScreen.java
com.capgemini.SalesOrder.preferences.GatewaySettingsPreferencesActivity.java
com.capgemini.SalesOrder.preferences.MainPreferencesActivity.java
com.capgemini.SalesOrder.preferences.PreferencesUtilities.java
com.capgemini.SalesOrder.preferences.SUPSettingsPreferencesActivity.java
com.capgemini.SalesOrder.zgwsample_srv.ServiceVersionConfigurations.java
com.capgemini.SalesOrder.zgwsample_srv.v0.ZGWSAMPLE_SRVRequestHandler.java
com.capgemini.SalesOrder.zgwsample_srv.v0.ZGWSAMPLE_SRVService.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.BusinessPartner.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.Contact.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.Product.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.SalesOrderLineItem.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.SalesOrder.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.IZGWSAMPLE_SRVRequestHandlerListener.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.ListenerWrapper.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.ZGWSAMPLE_SRVLoginAsyncTask.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.ZGWSAMPLE_SRVRequestID.java