<commit_before>package ubic.gemma.model.genome.gene.phenotype.valueObject;

import ubic.gemma.model.association.phenotype.PhenotypeAssociationPublication;
import ubic.gemma.model.common.description.BibliographicReferenceValueObject;
import ubic.gemma.model.common.description.CitationValueObject;

public class PhenotypeAssPubValueObject implements Comparable<PhenotypeAssPubValueObject> {

    private String type = null;
    private CitationValueObject citationValueObject = null;
    public static String PRIMARY = "Primary";
    public static String RELEVANT = "Relevant";

    public PhenotypeAssPubValueObject() {

    }

    public PhenotypeAssPubValueObject( PhenotypeAssociationPublication assocationPublication ) {
        this.type = assocationPublication.getType();
        if ( assocationPublication.getCitation() != null ) {
            this.citationValueObject = BibliographicReferenceValueObject.constructCitation( assocationPublication
                    .getCitation() );
        }
    }

    public static PhenotypeAssPubValueObject createPrimaryPublication( String accession ) {

        CitationValueObject citationValueObject = new CitationValueObject();
        citationValueObject.setPubmedAccession( accession );
        PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
        phenotypeAssPubValueObject.setType( PRIMARY );
        phenotypeAssPubValueObject.setCitationValueObject( citationValueObject );

        return phenotypeAssPubValueObject;
    }

    public static PhenotypeAssPubValueObject createRelevantPublication( String accession ) {
        CitationValueObject citationValueObject = new CitationValueObject();
        citationValueObject.setPubmedAccession( accession );
        PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
        phenotypeAssPubValueObject.setType( RELEVANT );
        phenotypeAssPubValueObject.setCitationValueObject( citationValueObject );

        return phenotypeAssPubValueObject;
    }

    public String getType() {
        return type;
    }

    public void setType( String type ) {
        this.type = type;
    }

    public CitationValueObject getCitationValueObject() {
        return citationValueObject;
    }

    public void setCitationValueObject( CitationValueObject citationValueObject ) {
        this.citationValueObject = citationValueObject;
    }

    @Override
    public int compareTo( PhenotypeAssPubValueObject phenotypeAssociationPublicationValueObject ) {

        int compare = this.type.compareTo( phenotypeAssociationPublicationValueObject.getType() );

        if ( compare == 0 ) {
            // TODO Auto-generated method stub
            compare = this.citationValueObject.compareTo( phenotypeAssociationPublicationValueObject
                    .getCitationValueObject() );
        }
<commit_msg>null check<commit_after>package ubic.gemma.model.genome.gene.phenotype.valueObject;

import ubic.gemma.model.association.phenotype.PhenotypeAssociationPublication;
import ubic.gemma.model.common.description.BibliographicReferenceValueObject;
import ubic.gemma.model.common.description.CitationValueObject;

public class PhenotypeAssPubValueObject implements Comparable<PhenotypeAssPubValueObject> {

    private String type = null;
    private CitationValueObject citationValueObject = null;
    public static String PRIMARY = "Primary";
    public static String RELEVANT = "Relevant";

    public PhenotypeAssPubValueObject() {

    }

    public PhenotypeAssPubValueObject( PhenotypeAssociationPublication assocationPublication ) {
        this.type = assocationPublication.getType();
        if ( assocationPublication.getCitation() != null ) {
            this.citationValueObject = BibliographicReferenceValueObject.constructCitation( assocationPublication
                    .getCitation() );
        }
    }

    public static PhenotypeAssPubValueObject createPrimaryPublication( String accession ) {

        CitationValueObject citationValueObject = new CitationValueObject();
        citationValueObject.setPubmedAccession( accession );
        PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
        phenotypeAssPubValueObject.setType( PRIMARY );
        phenotypeAssPubValueObject.setCitationValueObject( citationValueObject );

        return phenotypeAssPubValueObject;
    }

    public static PhenotypeAssPubValueObject createRelevantPublication( String accession ) {
        CitationValueObject citationValueObject = new CitationValueObject();
        citationValueObject.setPubmedAccession( accession );
        PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
        phenotypeAssPubValueObject.setType( RELEVANT );
        phenotypeAssPubValueObject.setCitationValueObject( citationValueObject );

        return phenotypeAssPubValueObject;
    }

    public String getType() {
        return type;
    }

    public void setType( String type ) {
        this.type = type;
    }

    public CitationValueObject getCitationValueObject() {
        return citationValueObject;
    }

    public void setCitationValueObject( CitationValueObject citationValueObject ) {
        this.citationValueObject = citationValueObject;
    }

    @Override
    public int compareTo( PhenotypeAssPubValueObject phenotypeAssociationPublicationValueObject ) {

        int compare = this.type.compareTo( phenotypeAssociationPublicationValueObject.getType() );

        if ( compare == 0 && this.citationValueObject != null
                && phenotypeAssociationPublicationValueObject.getCitationValueObject() != null ) {
            compare = this.citationValueObject.compareTo( phenotypeAssociationPublicationValueObject
                    .getCitationValueObject() );
        }

{'fraction_non_alphanumeric': 0.06302305721605465, 'fraction_numerical': 0.0003415883859948762, 'mean_word_length': 3.8881469115191987, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2021878', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1385, 'n_words': 271}