Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/sourcetools/objectmodel/com/ibm/j9tools/om/IFlagContainer.java
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2007, 2011 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* 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-exception
21
*******************************************************************************/
22
package com.ibm.j9tools.om;
23
24
import java.util.Map;
25
26
/**
27
* An interface supported by any object that contains flags.
28
*/
29
public interface IFlagContainer {
30
31
/**
32
* Adds a flag to this flag container. Typically this only affect local flags.
33
*
34
* @param flag An initialized instance of a Flag
35
*/
36
public void addFlag(Flag flag);
37
38
/**
39
* Removes the given flag from this container. Typically this only affect local flags.
40
*
41
* @param flag the flag to be removed
42
*/
43
public void removeFlag(Flag flag);
44
45
/**
46
* Removes the flag with the given ID from this container. Typically this only affect local flags.
47
*
48
* @param flagId the flag ID
49
*/
50
public void removeFlag(String flagId);
51
52
/**
53
* Checks for existence of a flag. Not to be confused with the value of a flag.
54
*
55
* @param flagId ID of the flag to check for
56
* @return True if a flag is defined for this container, false otherwise
57
*/
58
public boolean hasFlag(String flagId);
59
60
/**
61
* Checks for existence of a local flag. Not to be confused with the value of a flag.
62
*
63
* @param flagId ID of the local flag to check for
64
* @return True if a flag is local to this container, false otherwise
65
*/
66
public boolean hasLocalFlag(String flagId);
67
68
/**
69
* Retrieves the requested flag.
70
*
71
* @param flagId the ID of the requested flag
72
* @return the requested flag
73
*/
74
public Flag getFlag(String flagId);
75
76
/**
77
* Retrieves the requested local flag. This would not return any flags
78
* inherited from another {@link IFlagContainer}.
79
*
80
* @param flagId the ID of the requested flag
81
* @return the requested flag
82
*/
83
public Flag getLocalFlag(String flagId);
84
85
/**
86
* Retrieves all this container's flags.
87
*
88
* @return a <code>Map</code> of the container's flags, keyed by ID
89
*/
90
public Map<String, Flag> getFlags();
91
92
/**
93
* Retrieves all this container's flags for the given category.
94
*
95
* @param category the category for which to retrieve flags
96
* @return a <code>Map</code> of the container's flags, keyed by ID
97
*/
98
public Map<String, Flag> getFlags(String category);
99
100
/**
101
* Retrieves all the flags that are local to this container
102
*
103
* @return a <code>Map</code> of the container's flags, keyed by ID
104
*/
105
public Map<String, Flag> getLocalFlags();
106
107
/**
108
* Retrieves all the flags that are local to this container for the given category.
109
*
110
* @param category the category for which to retrieve flags
111
* @return a <code>Map</code> of the container's flags, keyed by ID
112
*/
113
public Map<String, Flag> getLocalFlags(String category);
114
}
115
116