Path: blob/master/sourcetools/objectmodel/com/ibm/j9tools/om/IFlagContainer.java
6004 views
/*******************************************************************************1* Copyright (c) 2007, 2011 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/21package com.ibm.j9tools.om;2223import java.util.Map;2425/**26* An interface supported by any object that contains flags.27*/28public interface IFlagContainer {2930/**31* Adds a flag to this flag container. Typically this only affect local flags.32*33* @param flag An initialized instance of a Flag34*/35public void addFlag(Flag flag);3637/**38* Removes the given flag from this container. Typically this only affect local flags.39*40* @param flag the flag to be removed41*/42public void removeFlag(Flag flag);4344/**45* Removes the flag with the given ID from this container. Typically this only affect local flags.46*47* @param flagId the flag ID48*/49public void removeFlag(String flagId);5051/**52* Checks for existence of a flag. Not to be confused with the value of a flag.53*54* @param flagId ID of the flag to check for55* @return True if a flag is defined for this container, false otherwise56*/57public boolean hasFlag(String flagId);5859/**60* Checks for existence of a local flag. Not to be confused with the value of a flag.61*62* @param flagId ID of the local flag to check for63* @return True if a flag is local to this container, false otherwise64*/65public boolean hasLocalFlag(String flagId);6667/**68* Retrieves the requested flag.69*70* @param flagId the ID of the requested flag71* @return the requested flag72*/73public Flag getFlag(String flagId);7475/**76* Retrieves the requested local flag. This would not return any flags77* inherited from another {@link IFlagContainer}.78*79* @param flagId the ID of the requested flag80* @return the requested flag81*/82public Flag getLocalFlag(String flagId);8384/**85* Retrieves all this container's flags.86*87* @return a <code>Map</code> of the container's flags, keyed by ID88*/89public Map<String, Flag> getFlags();9091/**92* Retrieves all this container's flags for the given category.93*94* @param category the category for which to retrieve flags95* @return a <code>Map</code> of the container's flags, keyed by ID96*/97public Map<String, Flag> getFlags(String category);9899/**100* Retrieves all the flags that are local to this container101*102* @return a <code>Map</code> of the container's flags, keyed by ID103*/104public Map<String, Flag> getLocalFlags();105106/**107* Retrieves all the flags that are local to this container for the given category.108*109* @param category the category for which to retrieve flags110* @return a <code>Map</code> of the container's flags, keyed by ID111*/112public Map<String, Flag> getLocalFlags(String category);113}114115116