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

b4j.core.AbstractBugzillaObject Maven / Gradle / Ivy

/*
 * This file is part of Bugzilla for Java.
 *
 *  Bugzilla for Java is free software: you can redistribute it 
 *  and/or modify it under the terms of version 3 of the GNU 
 *  Lesser General Public  License as published by the Free Software 
 *  Foundation.
 *  
 *  Bugzilla for Java is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public 
 *  License along with Bugzilla for Java.  If not, see 
 *  .
 */

package b4j.core;

import java.util.HashMap;
import java.util.Map;

/**
 * Provides the possibility to store custom values.
 * @author ralph
 * @since 2.0
 *
 */
public abstract class AbstractBugzillaObject implements BugzillaObject {

	private Map customFields;

	/**
	 * Constructor.
	 */
	public AbstractBugzillaObject() {
		customFields = new HashMap();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void set(String key, Object value) {
		customFields.put(key, value);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Object get(String key) {
		return customFields.get(key);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Iterable getCustomFieldNames() {
		return customFields.keySet();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int getCustomFieldCount() {
		return customFields.size();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy