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

mel.maven.camel-salesforce-maven-plugin.2.18.5.source-code.sobject-pojo.vm Maven / Gradle / Ivy

There is a newer version: 4.8.1
Show newest version
## ------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements.  See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License.  You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ------------------------------------------------------------------------
## sobject-pojo.vm
/*
 * Salesforce DTO generated by camel-salesforce-maven-plugin
 * Generated on: $generatedDate
 */
package $packageName;

## add imports for XStreamConverter and PicklistEnumConverter if needed
#set ( $hasPicklists = $utility.hasPicklists($desc) )
#set ( $hasMultiSelectPicklists = $utility.hasMultiSelectPicklists($desc) )
import com.thoughtworks.xstream.annotations.XStreamAlias;
#if ( ($hasPicklists && !$useStringsForPicklists) || $hasMultiSelectPicklists )
import com.thoughtworks.xstream.annotations.XStreamConverter;
#end
#if ( $hasPicklists && !$useStringsForPicklists )
import org.apache.camel.component.salesforce.api.PicklistEnumConverter;
#end
#if ( $hasMultiSelectPicklists )
#if ( $useStringsForPicklists )
import org.apache.camel.component.salesforce.api.StringMultiSelectPicklistConverter;
import org.apache.camel.component.salesforce.api.StringMultiSelectPicklistDeserializer;
import org.apache.camel.component.salesforce.api.StringMultiSelectPicklistSerializer;
#else
import org.apache.camel.component.salesforce.api.MultiSelectPicklistConverter;
import org.apache.camel.component.salesforce.api.MultiSelectPicklistDeserializer;
import org.apache.camel.component.salesforce.api.MultiSelectPicklistSerializer;
#end
#end
import org.apache.camel.component.salesforce.api.dto.AbstractSObjectBase;
import com.fasterxml.jackson.annotation.JsonProperty;
#if ( $hasMultiSelectPicklists )
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
#end

/**
 * Salesforce DTO for SObject $desc.Name
 */
@XStreamAlias("$desc.Name")
public class $desc.Name extends AbstractSObjectBase {

#foreach ( $field in $desc.Fields )
#if ( $utility.notBaseField($field.Name) )
#set ( $fieldName = $field.Name )
#set ( $fieldType = $utility.getFieldType($desc, $field) )
#set ( $isMultiSelectPicklist = $utility.isMultiSelectPicklist($field) )
    // $fieldName
#if ( $utility.isBlobField($field) )
#set ( $propertyName = $fieldName + "Url" )
#else
#set ( $propertyName = $fieldName )
#end
## add a converter annotation if needed
#if ( !$useStringsForPicklists && !$isMultiSelectPicklist && $utility.isPicklist($field) )
    @XStreamConverter(PicklistEnumConverter.class)
#elseif ( $isMultiSelectPicklist )
#if ( $useStringsForPicklists )
    @XStreamConverter(StringMultiSelectPicklistConverter.class)
#else
    @XStreamConverter(MultiSelectPicklistConverter.class)
#end
#else
## add an alias for blob field url if needed
#if ( $propertyName != $fieldName )
    // blob field url, use getBlobField to get the content
    @XStreamAlias("$fieldName")
#end
#end
    private $fieldType $propertyName;

    @JsonProperty("$fieldName")
#if ( $isMultiSelectPicklist )
#if ( $useStringsForPicklists )
    @JsonSerialize(using = StringMultiSelectPicklistSerializer.class)
#else
    @JsonSerialize(using = MultiSelectPicklistSerializer.class)
#end
    @JsonInclude(value = Include.ALWAYS)
#end
    public $fieldType get$propertyName() {
        return this.$propertyName;
    }

    @JsonProperty("$fieldName")
#if ( $isMultiSelectPicklist )
#if ( $useStringsForPicklists )
    @JsonDeserialize(using = StringMultiSelectPicklistDeserializer.class)
#else
    @JsonDeserialize(using = MultiSelectPicklistDeserializer.class)
#end
#end
    public void set$propertyName($fieldType $propertyName) {
        this.$propertyName = $propertyName;
    }

#end
#end
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy