Enum Class PropertyAccessLevel
java.lang.Object
java.lang.Enum<PropertyAccessLevel>
nl.pim16aap2.animatedarchitecture.core.structures.properties.PropertyAccessLevel
- All Implemented Interfaces:
Serializable, Comparable<PropertyAccessLevel>, Constable
Represents the access level of a property.
This determines to what extent a user can interact with the property.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe user can add this property to structures that do not yet have it.The property is editable by the user.The property is hidden from the user.The property is visible to the user but not directly editable.The user can remove this property from structures that have it. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<PropertyAccessLevel> A list of all values in this enum. -
Method Summary
Modifier and TypeMethodDescriptionintgetFlag()static intgetFlagOf(Collection<PropertyAccessLevel> levels) Returns the combined permission flag of the given access levels.static intgetFlagOf(PropertyAccessLevel... levels) Returns the combined permission flag of the given access levels.static booleanhasFlag(int permissionFlag, PropertyAccessLevel level) Checks if the given permission flag has the given access level.static booleanhasFlags(int permissionFlag, Collection<PropertyAccessLevel> levels) Checks if the given permission flag has all the given access levels.static booleanhasFlags(int permissionFlag, PropertyAccessLevel... levels) Checks if the given permission flag has all the given access levels.static booleanhasOneFlagOf(int permissionFlag, Collection<PropertyAccessLevel> levels) Checks if the given permission flag has at least one of the given access levels.static booleanhasOneFlagOf(int permissionFlag, PropertyAccessLevel... levels) Checks if the given permission flag has at least one of the given access levels.static PropertyAccessLevelReturns the enum constant of this class with the specified name.static PropertyAccessLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
The property is hidden from the user.It will not be shown in the GUI or in any other user-facing interface.
This is useful for properties that are only used strictly internally.
-
READ
The property is visible to the user but not directly editable.It may be shown in the GUI and in any other user-facing interface.
This is useful for properties that the user should be able to see but not change directly.
-
EDIT
The property is editable by the user.The user can directly change the value of this property.
-
ADD
The user can add this property to structures that do not yet have it. -
REMOVE
The user can remove this property from structures that have it.
-
-
Field Details
-
VALUES
A list of all values in this enum.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
hasFlags
Checks if the given permission flag has all the given access levels.- Parameters:
permissionFlag- The permission flag to check.levels- The access levels to check for.- Returns:
- True if the permission flag has all the given access levels, false otherwise.
-
hasFlags
Checks if the given permission flag has all the given access levels.- Parameters:
permissionFlag- The permission flag to check.levels- The access levels to check for.- Returns:
- True if the permission flag has all the given access levels, false otherwise.
-
hasOneFlagOf
Checks if the given permission flag has at least one of the given access levels.- Parameters:
permissionFlag- The permission flag to check.levels- The access levels to check for.- Returns:
- True if the permission flag has at least one of the given access levels, false otherwise.
-
hasOneFlagOf
Checks if the given permission flag has at least one of the given access levels.- Parameters:
permissionFlag- The permission flag to check.levels- The access levels to check for.- Returns:
- True if the permission flag has at least one of the given access levels, false otherwise.
-
hasFlag
Checks if the given permission flag has the given access level.- Parameters:
permissionFlag- The permission flag to check.level- The access level to check for.- Returns:
- True if the permission flag has the given access level, false otherwise.
-
getFlagOf
Returns the combined permission flag of the given access levels.- Parameters:
levels- The access levels to combine.- Returns:
- The combined permission flag.
-
getFlagOf
Returns the combined permission flag of the given access levels.- Parameters:
levels- The access levels to combine.- Returns:
- The combined permission flag.
-
getFlag
public int getFlag()
-