mel.maven.camel-salesforce-maven-plugin.2.18.5.source-code.sobject-pojo-optional.vm Maven / Gradle / Ivy
## ------------------------------------------------------------------------
## 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;
import java.util.Optional;
## 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;
#end
/**
* Salesforce DTO for SObject $desc.Name
*/
@XStreamAlias("${desc.Name}Optional")
public class ${desc.Name}Optional 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 Optional<$fieldType> $propertyName;
@JsonProperty("$fieldName")
#if ( $isMultiSelectPicklist )
#if ( $useStringsForPicklists )
@JsonSerialize(using = StringMultiSelectPicklistSerializer.class)
#else
@JsonSerialize(using = MultiSelectPicklistSerializer.class)
#end
#end
public Optional<$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(Optional<$fieldType> $propertyName) {
this.$propertyName = $propertyName;
}
#end
#end
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy