All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.mt.subscription.DbIdentifiersHana Maven / Gradle / Ivy

There is a newer version: 3.3.1
Show newest version
/*******************************************************************************
 *   © 2019-2024 SAP SE or an SAP affiliate company. All rights reserved.
 ******************************************************************************/

package com.sap.cloud.mt.subscription;

import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class DbIdentifiersHana implements DbIdentifiers {
	private final Set dbIds = ConcurrentHashMap.newKeySet();

	public DbIdentifiersHana(Set dbIds) {
		if (dbIds != null) {
			this.dbIds.addAll(dbIds);
		}
	}

	public DbIdentifiersHana(DbIdentifiersHana dbIdentifiers) {
		this(dbIdentifiers != null ? dbIdentifiers.getDbIds() : null);
	}

	public Set getDbIds() {
		return Collections.unmodifiableSet(dbIds);
	}

	public void add(String dbId) {
		dbIds.add(dbId);
	}

	public void remove(String dbId) {
		dbIds.remove(dbId);
	}

	@Override
	public boolean areSet() {
		return dbIds != null && !dbIds.isEmpty();
	}

	@Override
	public DB getDB() {
		return DB.HANA;
	}

	@Override
	public DbIdentifiers createCopy() {
		return new DbIdentifiersHana(this);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy