All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sforce.soap.partner.KnowledgeSettings Maven / Gradle / Ivy

The newest version!
package com.sforce.soap.partner;

/**
 * This is a generated class for the SObject Enterprise API.
 * Do not edit this file, as your changes will be lost.
 */
public class KnowledgeSettings implements com.sforce.ws.bind.XMLizable , IKnowledgeSettings{

    /**
     * Constructor
     */
    public KnowledgeSettings() {}

    /* Cache the typeInfo instead of declaring static fields throughout*/
    private transient java.util.Map typeInfoCache = new java.util.HashMap();
    private com.sforce.ws.bind.TypeInfo _lookupTypeInfo(String fieldName, String namespace, String name, String typeNS, String type, int minOcc, int maxOcc, boolean elementForm) {
      com.sforce.ws.bind.TypeInfo typeInfo = typeInfoCache.get(fieldName);
      if (typeInfo == null) {
        typeInfo = new com.sforce.ws.bind.TypeInfo(namespace, name, typeNS, type, minOcc, maxOcc, elementForm);
        typeInfoCache.put(fieldName, typeInfo);
      }
      return typeInfo;
    }

    /**
     * element : defaultLanguage of type {http://www.w3.org/2001/XMLSchema}string
     * java type: java.lang.String
     */
    private boolean defaultLanguage__is_set = false;

    private java.lang.String defaultLanguage;

    @Override
    public java.lang.String getDefaultLanguage() {
      return defaultLanguage;
    }

    @Override
    public void setDefaultLanguage(java.lang.String defaultLanguage) {
      this.defaultLanguage = defaultLanguage;
      defaultLanguage__is_set = true;
    }

    protected void setDefaultLanguage(com.sforce.ws.parser.XmlInputStream __in,
        com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
      __in.peekTag();
      if (__typeMapper.isElement(__in, _lookupTypeInfo("defaultLanguage", "urn:partner.soap.sforce.com","defaultLanguage","http://www.w3.org/2001/XMLSchema","string",0,1,true))) {
        setDefaultLanguage(__typeMapper.readString(__in, _lookupTypeInfo("defaultLanguage", "urn:partner.soap.sforce.com","defaultLanguage","http://www.w3.org/2001/XMLSchema","string",0,1,true), java.lang.String.class));
      }
    }

    private void writeFieldDefaultLanguage(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
      __typeMapper.writeObject(__out, _lookupTypeInfo("defaultLanguage", "urn:partner.soap.sforce.com","defaultLanguage","http://www.w3.org/2001/XMLSchema","string",0,1,true), defaultLanguage, defaultLanguage__is_set);
    }

    /**
     * element : knowledgeEnabled of type {http://www.w3.org/2001/XMLSchema}boolean
     * java type: boolean
     */
    private boolean knowledgeEnabled__is_set = false;

    private boolean knowledgeEnabled;

    @Override
    public boolean getKnowledgeEnabled() {
      return knowledgeEnabled;
    }

    @Override
    public boolean isKnowledgeEnabled() {
      return knowledgeEnabled;
    }

    @Override
    public void setKnowledgeEnabled(boolean knowledgeEnabled) {
      this.knowledgeEnabled = knowledgeEnabled;
      knowledgeEnabled__is_set = true;
    }

    protected void setKnowledgeEnabled(com.sforce.ws.parser.XmlInputStream __in,
        com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
      __in.peekTag();
      if (__typeMapper.verifyElement(__in, _lookupTypeInfo("knowledgeEnabled", "urn:partner.soap.sforce.com","knowledgeEnabled","http://www.w3.org/2001/XMLSchema","boolean",1,1,true))) {
        setKnowledgeEnabled(__typeMapper.readBoolean(__in, _lookupTypeInfo("knowledgeEnabled", "urn:partner.soap.sforce.com","knowledgeEnabled","http://www.w3.org/2001/XMLSchema","boolean",1,1,true), boolean.class));
      }
    }

    private void writeFieldKnowledgeEnabled(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
      __typeMapper.writeObject(__out, _lookupTypeInfo("knowledgeEnabled", "urn:partner.soap.sforce.com","knowledgeEnabled","http://www.w3.org/2001/XMLSchema","boolean",1,1,true), knowledgeEnabled, knowledgeEnabled__is_set);
    }

    /**
     * element : languages of type {urn:partner.soap.sforce.com}KnowledgeLanguageItem
     * java type: com.sforce.soap.partner.KnowledgeLanguageItem[]
     */
    private boolean languages__is_set = false;

    private com.sforce.soap.partner.KnowledgeLanguageItem[] languages = new com.sforce.soap.partner.KnowledgeLanguageItem[0];

    @Override
    public com.sforce.soap.partner.KnowledgeLanguageItem[] getLanguages() {
      return languages;
    }

    @Override
    public void setLanguages(com.sforce.soap.partner.IKnowledgeLanguageItem[] languages) {
      this.languages = castArray(com.sforce.soap.partner.KnowledgeLanguageItem.class, languages);
      languages__is_set = true;
    }

    protected void setLanguages(com.sforce.ws.parser.XmlInputStream __in,
        com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
      __in.peekTag();
      if (__typeMapper.isElement(__in, _lookupTypeInfo("languages", "urn:partner.soap.sforce.com","languages","urn:partner.soap.sforce.com","KnowledgeLanguageItem",0,-1,true))) {
        setLanguages((com.sforce.soap.partner.KnowledgeLanguageItem[])__typeMapper.readObject(__in, _lookupTypeInfo("languages", "urn:partner.soap.sforce.com","languages","urn:partner.soap.sforce.com","KnowledgeLanguageItem",0,-1,true), com.sforce.soap.partner.KnowledgeLanguageItem[].class));
      }
    }

    private void writeFieldLanguages(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
      __typeMapper.writeObject(__out, _lookupTypeInfo("languages", "urn:partner.soap.sforce.com","languages","urn:partner.soap.sforce.com","KnowledgeLanguageItem",0,-1,true), languages, languages__is_set);
    }

    /**
     */
    @Override
    public void write(javax.xml.namespace.QName __element,
        com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper)
        throws java.io.IOException {
      __out.writeStartTag(__element.getNamespaceURI(), __element.getLocalPart());
      writeFields(__out, __typeMapper);
      __out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
    }

    protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out,
         com.sforce.ws.bind.TypeMapper __typeMapper)
         throws java.io.IOException {
       writeFields1(__out, __typeMapper);
    }

    @Override
    public void load(com.sforce.ws.parser.XmlInputStream __in,
        com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
      __typeMapper.consumeStartTag(__in);
      loadFields(__in, __typeMapper);
      __typeMapper.consumeEndTag(__in);
    }

    protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
        com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
        loadFields1(__in, __typeMapper);
    }

    @Override
    public String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder();
      sb.append("[KnowledgeSettings ");
      toString1(sb);

      sb.append("]\n");
      return sb.toString();
    }

    private void toStringHelper(StringBuilder sb, String name, Object value) {
      sb.append(' ').append(name).append("='").append(com.sforce.ws.util.Verbose.toString(value)).append("'\n");
    }

    private void writeFields1(com.sforce.ws.parser.XmlOutputStream __out,
         com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
      writeFieldDefaultLanguage(__out, __typeMapper);
      writeFieldKnowledgeEnabled(__out, __typeMapper);
      writeFieldLanguages(__out, __typeMapper);
    }

    private void loadFields1(com.sforce.ws.parser.XmlInputStream __in,
        com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
      setDefaultLanguage(__in, __typeMapper);
      setKnowledgeEnabled(__in, __typeMapper);
      setLanguages(__in, __typeMapper);
    }

    private void toString1(StringBuilder sb) {
      toStringHelper(sb, "defaultLanguage", defaultLanguage);
      toStringHelper(sb, "knowledgeEnabled", knowledgeEnabled);
      toStringHelper(sb, "languages", languages);
    }


    @SuppressWarnings("unchecked")
    private  T[] castArray(Class clazz, U[] array) {
        if (array == null) {
            return null;
        }
        T[] retVal = (T[]) java.lang.reflect.Array.newInstance(clazz, array.length);
        for (int i=0; i < array.length; i++) {
            retVal[i] = (T)array[i];
        }

        return retVal;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy