001/* 002 * #%L 003 * Netarchivesuite - harvester 004 * %% 005 * Copyright (C) 2005 - 2014 The Royal Danish Library, the Danish State and University Library, 006 * the National Library of France and the Austrian National Library. 007 * %% 008 * This program is free software: you can redistribute it and/or modify 009 * it under the terms of the GNU Lesser General Public License as 010 * published by the Free Software Foundation, either version 2.1 of the 011 * License, or (at your option) any later version. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Lesser Public License for more details. 017 * 018 * You should have received a copy of the GNU General Lesser Public 019 * License along with this program. If not, see 020 * <http://www.gnu.org/licenses/lgpl-2.1.html>. 021 * #L% 022 */ 023package dk.netarkivet.harvester.datamodel; 024 025import java.util.List; 026 027import dk.netarkivet.common.exceptions.ArgumentNotValid; 028 029/** 030 * Reduced version of the Domain class for presentation purposes. Immutable. (domain configuration list not enforced 031 * immutable though). 032 * 033 * @see Domain 034 */ 035public class SparseDomain { 036 037 /** The domain name. */ 038 private final String domainName; 039 /** List of names of all configurations. */ 040 private final List<String> domainConfigurationNames; 041 042 /** 043 * Create new instance of a sparse domain. 044 * 045 * @param domainName Domains name. 046 * @param domainConfigurationNames List of names of all configurations for domain. 047 * @throws ArgumentNotValid if either of the arguments are null or empty. 048 */ 049 public SparseDomain(String domainName, List<String> domainConfigurationNames) { 050 ArgumentNotValid.checkNotNullOrEmpty(domainName, "domainName"); 051 ArgumentNotValid.checkNotNullOrEmpty(domainConfigurationNames, "domainConfigurationNames"); 052 this.domainName = domainName; 053 this.domainConfigurationNames = domainConfigurationNames; 054 } 055 056 /** 057 * Gets the name of this domain. 058 * 059 * @return the name of this domain 060 */ 061 public String getName() { 062 return domainName; 063 } 064 065 /** 066 * Gets the names of configurations in this domain. 067 * 068 * @return the names of all configurations for this domain. 069 */ 070 public Iterable<String> getDomainConfigurationNames() { 071 return domainConfigurationNames; 072 } 073 074}