<commit_before>/**
 * Copyright 2005-2012 The Kuali Foundation
 *
 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
 *
 * 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.
 */
package org.kuali.rice.coreservice.impl.parameter;


import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.FetchType
import javax.persistence.Id
import javax.persistence.IdClass
import javax.persistence.JoinColumn
import javax.persistence.ManyToOne
import javax.persistence.OneToOne
import javax.persistence.Table
import org.kuali.rice.coreservice.api.parameter.EvaluationOperator
import org.kuali.rice.coreservice.api.parameter.ParameterContract
import org.kuali.rice.coreservice.impl.component.ComponentBo
import org.kuali.rice.coreservice.impl.namespace.NamespaceBo
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
import org.kuali.rice.coreservice.impl.component.DerivedComponentBo
import org.kuali.rice.coreservice.impl.component.ComponentBo

@IdClass(ParameterId.class)
@Entity
@Table(name = "KRCR_PARM_T")
public class ParameterBo extends PersistableBusinessObjectBase implements ParameterContract {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "NMSPC_CD")
    def String namespaceCode

    @Id
    @Column(name = "CMPNT_CD")
    def String componentCode

    @Id
    @Column(name = "PARM_NM")
    def String name

    @Id
    @Column(name = "APPL_ID")
    def String applicationId

    @Column(name = "VAL")
    def String value

    @Column(name = "PARM_DESC_TXT", length = 2048)
    def String description

    @Column(name = "PARM_TYP_CD")
    def String parameterTypeCode

    @Column(name = "EVAL_OPRTR_CD")
    def String evaluationOperatorCode

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "NMSPC_CD", insertable = false, updatable = false)
    def NamespaceBo namespace

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARM_TYP_CD", insertable = false, updatable = false)
    def ParameterTypeBo parameterType

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARM_TYP_CD", insertable = false, updatable = false)
    def ComponentBo component

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARM_TYP_CD", insertable = false, updatable = false)
    def DerivedComponentBo derivedComponent

    /**
     * Converts a mutable bo to its immutable counterpart
     * @param bo the mutable business object
     * @return the immutable object
     */
    static org.kuali.rice.coreservice.api.parameter.Parameter to(ParameterBo bo) {
        if (bo == null) {
            return null
        }

        return org.kuali.rice.coreservice.api.parameter.Parameter.Builder.create(bo).build();
    }

    /**
     * Converts a immutable object to its mutable counterpart
     * @param im immutable object
     * @return the mutable bo
     */
    static ParameterBo from(org.kuali.rice.coreservice.api.parameter.Parameter im) {
        if (im == null) {
            return null
        }

        ParameterBo bo = new ParameterBo()
        bo.namespaceCode = im.namespaceCode
        bo.componentCode = im.componentCode
        bo.name = im.name
        bo.applicationId = im.applicationId
        bo.value = im.value
        bo.description = im.description
        bo.parameterTypeCode = im.parameterType.code
        if(null != im.evaluationOperator){
            bo.evaluationOperatorCode = im.evaluationOperator.code
        }
        bo.parameterType = ParameterTypeBo.from(im.parameterType)
        bo.versionNumber = im.versionNumber
		bo.objectId = im.objectId;

        return bo
    }

    @Override
    ParameterTypeBo getParameterType() {
        return parameterType
    }
	
	@Override
	EvaluationOperator getEvaluationOperator() {
		return EvaluationOperator.fromCode(evaluationOperatorCode);
	}
}

<commit_msg>KULRICE-6800 - remove 'def' from ParameterBo<commit_after>/**
 * Copyright 2005-2012 The Kuali Foundation
 *
 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
 *
 * 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.
 */
package org.kuali.rice.coreservice.impl.parameter;


import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.FetchType
import javax.persistence.Id
import javax.persistence.IdClass
import javax.persistence.JoinColumn
import javax.persistence.ManyToOne
import javax.persistence.OneToOne
import javax.persistence.Table
import org.kuali.rice.coreservice.api.parameter.EvaluationOperator
import org.kuali.rice.coreservice.api.parameter.ParameterContract
import org.kuali.rice.coreservice.impl.component.ComponentBo
import org.kuali.rice.coreservice.impl.namespace.NamespaceBo
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
import org.kuali.rice.coreservice.impl.component.DerivedComponentBo
import org.kuali.rice.coreservice.impl.component.ComponentBo

@IdClass(ParameterId.class)
@Entity
@Table(name = "KRCR_PARM_T")
public class ParameterBo extends PersistableBusinessObjectBase implements ParameterContract {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "NMSPC_CD")
    String namespaceCode

    @Id
    @Column(name = "CMPNT_CD")
    String componentCode

    @Id
    @Column(name = "PARM_NM")
    String name

    @Id
    @Column(name = "APPL_ID")
    String applicationId

    @Column(name = "VAL")
    String value

    @Column(name = "PARM_DESC_TXT", length = 2048)
    String description

    @Column(name = "PARM_TYP_CD")
    String parameterTypeCode

    @Column(name = "EVAL_OPRTR_CD")
    String evaluationOperatorCode

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "NMSPC_CD", insertable = false, updatable = false)
    NamespaceBo namespace

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARM_TYP_CD", insertable = false, updatable = false)
    ParameterTypeBo parameterType

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARM_TYP_CD", insertable = false, updatable = false)
    ComponentBo component

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARM_TYP_CD", insertable = false, updatable = false)
    DerivedComponentBo derivedComponent

    /**
     * Converts a mutable bo to its immutable counterpart
     * @param bo the mutable business object
     * @return the immutable object
     */
    static org.kuali.rice.coreservice.api.parameter.Parameter to(ParameterBo bo) {
        if (bo == null) {
            return null
        }

        return org.kuali.rice.coreservice.api.parameter.Parameter.Builder.create(bo).build();
    }

    /**
     * Converts a immutable object to its mutable counterpart
     * @param im immutable object
     * @return the mutable bo
     */
    static ParameterBo from(org.kuali.rice.coreservice.api.parameter.Parameter im) {
        if (im == null) {
            return null
        }

        ParameterBo bo = new ParameterBo()
        bo.namespaceCode = im.namespaceCode
        bo.componentCode = im.componentCode
        bo.name = im.name
        bo.applicationId = im.applicationId
        bo.value = im.value
        bo.description = im.description
        bo.parameterTypeCode = im.parameterType.code
        if(null != im.evaluationOperator){
            bo.evaluationOperatorCode = im.evaluationOperator.code
        }
        bo.parameterType = ParameterTypeBo.from(im.parameterType)
        bo.versionNumber = im.versionNumber
		bo.objectId = im.objectId;

        return bo
    }

    @Override
    ParameterTypeBo getParameterType() {
        return this.parameterType
    }
	
	@Override
	EvaluationOperator getEvaluationOperator() {
		return EvaluationOperator.fromCode(evaluationOperatorCode);
	}
}


{'fraction_non_alphanumeric': 0.08344594594594594, 'fraction_numerical': 0.004054054054054054, 'mean_word_length': 2.984297891431135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6277356', 'n_tokens_mistral': 2767, 'n_tokens_neox': 2525, 'n_words': 632}