<commit_before>package org.sbolstandard.core2;

import java.net.URI;

import static org.sbolstandard.core2.URIcompliance.*;

import javax.xml.namespace.QName;

/**
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @version 2.0-beta
 */

public class GenericTopLevel extends TopLevel{

	private QName rdfType;
	
	GenericTopLevel(URI identity, QName rdfType) {
		super(identity);
		this.rdfType = rdfType;
		if (rdfType.getPrefix().toString().equals("sbol")) {
			throw new SBOLException(rdfType.getLocalPart()+" is not an SBOL object, so it cannot be in the SBOL namespace.");
		}
	}
	
	private GenericTopLevel(GenericTopLevel genericTopLevel) {
		super(genericTopLevel);
		this.setRDFType(genericTopLevel.getRDFType());
	}

	/**
	 * Returns the RDF type property of this GenericTopLevel object.
	 * @return the RDF type property of this GenericTopLevel object.
	 */
	public QName getRDFType() {
		return rdfType;
	}

	/**
	 * Set the RDF type property of this GenericTopLevel object to the specified one.
	 * <p>
	 * If this ComponentDefinition object belongs to an SBOLDocument instance, then
	 * the SBOLDcouement instance is checked for compliance first. Only a compliant SBOLDocument instance
	 * is allowed to be edited.
	 *
	 * @param rdfType
	 * @throws SBOLException if the associated SBOLDocument is not compliant.
	 */
	public void setRDFType(QName rdfType) {
		if (sbolDocument!=null) sbolDocument.checkReadOnly();
		this.rdfType = rdfType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((rdfType == null) ? 0 : rdfType.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())<commit_msg>Check if RDF type is null in set method.<commit_after>package org.sbolstandard.core2;

import java.net.URI;

import static org.sbolstandard.core2.URIcompliance.*;

import javax.xml.namespace.QName;

/**
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 * @version 2.0-beta
 */

public class GenericTopLevel extends TopLevel{

	private QName rdfType;
	
	GenericTopLevel(URI identity, QName rdfType) {
		super(identity);
		this.rdfType = rdfType;
		if (rdfType.getPrefix().toString().equals("sbol")) {
			throw new SBOLException(rdfType.getLocalPart()+" is not an SBOL object, so it cannot be in the SBOL namespace.");
		}
	}
	
	private GenericTopLevel(GenericTopLevel genericTopLevel) {
		super(genericTopLevel);
		this.setRDFType(genericTopLevel.getRDFType());
	}

	/**
	 * Returns the RDF type property of this GenericTopLevel object.
	 * @return the RDF type property of this GenericTopLevel object.
	 */
	public QName getRDFType() {
		return rdfType;
	}

	/**
	 * Set the RDF type property of this GenericTopLevel object to the specified one.
	 * <p>
	 * If this ComponentDefinition object belongs to an SBOLDocument instance, then
	 * the SBOLDcouement instance is checked for compliance first. Only a compliant SBOLDocument instance
	 * is allowed to be edited.
	 *
	 * @param rdfType
	 * @throws SBOLException if the associated SBOLDocument is not compliant.
	 */
	public void setRDFType(QName rdfType) {
		if (sbolDocument!=null) sbolDocument.checkReadOnly();
		if (rdfType == null) {
			throw new IllegalArgumentException("RDF type is a required field.");
		}
		this.rdfType = rdfType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((rdfType == null) ? 0 : rdfType.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
{'fraction_non_alphanumeric': 0.11148300720906282, 'fraction_numerical': 0.003604531410916581, 'mean_word_length': 4.006443298969073, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6986635', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1222, 'n_words': 386}