<commit_before>/*
 * Copyright 2011-2015 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed 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.
 */
package com.b2international.snowowl.api.impl.codesystem.domain;

import org.hibernate.validator.constraints.NotEmpty;

import com.b2international.snowowl.api.codesystem.domain.ICodeSystem;

/**
 */
public class CodeSystem implements ICodeSystem {

	private String oid;
	
	@NotEmpty
	private String name;
	@NotEmpty
	private String shortName;
	
	private String organizationLink;
	
	@NotEmpty
	private String primaryLanguage;
	@NotEmpty
	private String citation;<commit_msg>Builder to build api code systems.<commit_after>/*
 * Copyright 2011-2015 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed 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.
 */
package com.b2international.snowowl.api.impl.codesystem.domain;

import org.hibernate.validator.constraints.NotEmpty;

import com.b2international.snowowl.api.codesystem.domain.ICodeSystem;

/**
 */
public class CodeSystem implements ICodeSystem {
	
	public static Builder builder() {
		return new Builder();
	}
	
	public static Builder builder(final com.b2international.snowowl.datastore.ICodeSystem input) {
		return builder()
				.oid(input.getOid())
				.name(input.getName())
				.shortName(input.getShortName())
				.link(input.getOrgLink())
				.language(input.getLanguage())
				.citation(input.getCitation())
				.branchPath(input.getBranchPath())
				.iconPath(input.getIconPath())
				.terminologyId(input.getSnowOwlId())
				.repositoryId(input.getRepositoryUuid())
				.extensionOf(input.getExtensionOf());
	}
	
	public static class Builder {
		
		private String oid;
		private String name;
		private String shortName;
		private String link;
		private String language;
		private String citation;
		private String branchPath;
		private String iconPath;
		private String terminologyId;
		private String repositoryId;
		private String extensionOf;
		
		private Builder() {}
		
		public Builder oid(final String oid) {
			this.oid = oid;
			return getSelf();
		}
		
		public Builder name(final String name) {
			this.name = name;
			return getSelf();
		}
		
		public Builder shortName(final String shortName) {
			this.shortName = shortName;
			return getSelf();
		}
		
		public Builder link(final String link) {
			this.link = link;
			return getSelf();
		}
		
		public Builder language(final String language) {
			this.language = language;
			return getSelf();
		}
		
		public Builder citation(final String citation) {
			this.citation = citation;
			return getSelf();
		}
		
		public Builder branchPath(final String branchPath) {
			this.branchPath = branchPath;
			return getSelf();
		}
		
		public Builder iconPath(final String iconPath) {
			this.iconPath = iconPath;
			return getSelf();
		}
		
		public Builder terminologyId(final String terminologyId) {
			this.terminologyId = terminologyId;
			return getSelf();
		}
		
		public Builder repositoryId(final String repositoryId) {
			this.repositoryId = repositoryId;
			return getSelf();
		}
		
		public Builder extensionOf(final String extensionOf) {
			this.extensionOf = extensionOf;
			return getSelf();
		}
		
		public CodeSystem build() {
			return new CodeSystem(
					oid, 
					name, 
					shortName, 
					link, 
					language, 
					citation, 
					branchPath, 
					iconPath, 
					terminologyId, 
					repositoryId,
					extensionOf);
		}
		
		private Builder getSelf() {
			return this;
		}
		
	}
	
	public CodeSystem() {
	}
	
	private CodeSystem(final String oid, final String name, final String shortName, final String link, final String language,
			final String citation, final String branchPath, final String iconPath, final String terminologyId, final String repositoryId,
			final String extensionOf) {
		this.oid = oid;
		this.name = name;
		this.shortName = shortName;
		this.organizationLink = link;
		this.primaryLanguage = language;
		this.citation = citation;
		this.branchPath = branchPath;
		this.iconPath = iconPath;
		this.terminologyId = terminologyId;
		this.repositoryUuid = repositoryId;
		this.extensionOf = extensionOf;
	}

	private String oid;
	
	@NotEmpty
	private String name;
	@NotEmpty
	private String shortName;
	
	private String organizationLink;
	
	@NotEmpty
	private String primaryLanguage;
	@NotEmpty
	private String citation;
{'fraction_non_alphanumeric': 0.08534984055524292, 'fraction_numerical': 0.0061902082160945416, 'mean_word_length': 3.685413005272408, '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': '5457759', 'n_tokens_mistral': 1788, 'n_tokens_neox': 1483, 'n_words': 486}