<commit_before><%
boolean versionConst = extraParam.versionConst

def memberVisibility = extraParam.memberVisibility && extraParam.memberVisibility.toLowerCase()=='protected' ? 'protected' : 'private'
def hasUuid = !currentType.properties.findAll { it.type.name() == 'UUID'}.isEmpty()
def import = hasUuid ? '\nimport java.util.UUID;\n' : ''

%>package ${extraParam.packageName};
${import}
// This class is generated by the jsonCodeGen bean template (bean.txt), changes have to implement there

<% if ( currentType.description ) { %>
/**
 * ${currentType.description}
 */
<% } %>
public class ${ upperCamelCase.call(currentType.name) } {
    <% if (versionConst) {
    %>
    /**
     * Resulting from the model description
     */
    public final static int TYPE_VERSION=${currentType.version};

    /**
     * Version information for a concrete object. It can differ from model type version f.e. in
     * case of deserialization from message broker content
     */
    private Integer _objectVersion=${currentType.version};

    public void set_objectVersion(Integer version) {
        this._objectVersion = version;
    }

    public Integer get_objectVersion() {
        return this._objectVersion;
    }

    <% } %>
    <% currentType.properties.each { prop -> %>
    <% if (prop.description) {
    %>/**
     * ${prop.description}
     */
    <% }
    if (!prop.type.isArray) {
    %>${memberVisibility} ${ typeToJava.call(prop.type) } ${prop.name};
    <% } else {
    %>${memberVisibility} ${ typeToJava.call(prop.type) } ${prop.name} = new java.util.ArrayList<>();
    <% }
    %>
    public ${ typeToJava.call(prop.type) } get${ firstUpperCase.call(prop.name) } () { return this.${prop.name}; }

    public void set${ firstUpperCase.call(prop.name) } (${ typeToJava.call(prop.type) } ${prop.name}) {
        <% if (!prop.type.isArray) {
        %>this.${prop.name} = ${prop.name};
        <% } else {
        %>this.${prop.name} = ${prop.name}!=null ? ${prop.name} : new java.util.ArrayList<>();
        <% }
        %>
    }

    <% } %>

    @Override
    public boolean equals(Object obj) {
        if (obj==null) return false;
        if ( ! (obj instanceof ${ upperCamelCase.call(currentType.name) })) return false;

        ${ upperCamelCase.call(currentType.name) } _typeInst = (${ upperCamelCase.call(currentType.name) }) obj;
       // handling of non-array-types
    <% currentType.properties.findAll{ prop -> ! prop.type.isArray }.each { prop -> %>
        ${ typeToJava.call(prop.type) } _${prop.name} = _typeInst.get${ firstUpperCase.call(prop.name) } ();
        if (this.${prop.name} == null && _${prop.name} != null) return false;
        if (this.${prop.name} != null) {
            if (!this.${prop.name}.equals(_${prop.name})) return false;
        }
    <% } %>
       // handling of array-types
    <% currentType.properties.findAll{ prop -> prop.type.isArray }.each { prop -> %>
        ${ typeToJava.call(prop.type) } _${prop.name} = _typeInst.get${ firstUpperCase.call(prop.name) } ();
        if (this.${prop.name} == null && (_${prop.name} != null && _${prop.name}.size()>0)) return false;
        if (this.${prop.name} != null && this.${prop.name}.size()>0) {
            if (!this.${prop.name}.equals(_${prop.name})) return false;
        }
    <% } %>
        return true;
    }

}<commit_msg>fix import error in java bean template<commit_after><%
boolean versionConst = extraParam.versionConst

def memberVisibility = extraParam.memberVisibility && extraParam.memberVisibility.toLowerCase()=='protected' ? 'protected' : 'private'
def hasUuid = !currentType.properties.findAll { it.type.name() == 'UUID'}.isEmpty()
def importStr = hasUuid ? '\nimport java.util.UUID;\n' : ''

%>package ${extraParam.packageName};
${importStr}
// This class is generated by the jsonCodeGen bean template (bean.txt), changes have to implement there

<% if ( currentType.description ) { %>
/**
 * ${currentType.description}
 */
<% } %>
public class ${ upperCamelCase.call(currentType.name) } {
    <% if (versionConst) {
    %>
    /**
     * Resulting from the model description
     */
    public final static int TYPE_VERSION=${currentType.version};

    /**
     * Version information for a concrete object. It can differ from model type version f.e. in
     * case of deserialization from message broker content
     */
    private Integer _objectVersion=${currentType.version};

    public void set_objectVersion(Integer version) {
        this._objectVersion = version;
    }

    public Integer get_objectVersion() {
        return this._objectVersion;
    }

    <% } %>
    <% currentType.properties.each { prop -> %>
    <% if (prop.description) {
    %>/**
     * ${prop.description}
     */
    <% }
    if (!prop.type.isArray) {
    %>${memberVisibility} ${ typeToJava.call(prop.type) } ${prop.name};
    <% } else {
    %>${memberVisibility} ${ typeToJava.call(prop.type) } ${prop.name} = new java.util.ArrayList<>();
    <% }
    %>
    public ${ typeToJava.call(prop.type) } get${ firstUpperCase.call(prop.name) } () { return this.${prop.name}; }

    public void set${ firstUpperCase.call(prop.name) } (${ typeToJava.call(prop.type) } ${prop.name}) {
        <% if (!prop.type.isArray) {
        %>this.${prop.name} = ${prop.name};
        <% } else {
        %>this.${prop.name} = ${prop.name}!=null ? ${prop.name} : new java.util.ArrayList<>();
        <% }
        %>
    }

    <% } %>

    @Override
    public boolean equals(Object obj) {
        if (obj==null) return false;
        if ( ! (obj instanceof ${ upperCamelCase.call(currentType.name) })) return false;

        ${ upperCamelCase.call(currentType.name) } _typeInst = (${ upperCamelCase.call(currentType.name) }) obj;
       // handling of non-array-types
    <% currentType.properties.findAll{ prop -> ! prop.type.isArray }.each { prop -> %>
        ${ typeToJava.call(prop.type) } _${prop.name} = _typeInst.get${ firstUpperCase.call(prop.name) } ();
        if (this.${prop.name} == null && _${prop.name} != null) return false;
        if (this.${prop.name} != null) {
            if (!this.${prop.name}.equals(_${prop.name})) return false;
        }
    <% } %>
       // handling of array-types
    <% currentType.properties.findAll{ prop -> prop.type.isArray }.each { prop -> %>
        ${ typeToJava.call(prop.type) } _${prop.name} = _typeInst.get${ firstUpperCase.call(prop.name) } ();
        if (this.${prop.name} == null && (_${prop.name} != null && _${prop.name}.size()>0)) return false;
        if (this.${prop.name} != null && this.${prop.name}.size()>0) {
            if (!this.${prop.name}.equals(_${prop.name})) return false;
        }
    <% } %>
        return true;
    }

}
{'fraction_non_alphanumeric': 0.17907774958961348, 'fraction_numerical': 0.0005969258319653783, 'mean_word_length': 2.8672821696480093, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3619772', 'n_tokens_mistral': 2129, 'n_tokens_neox': 2073, 'n_words': 416}