Enum Class PropertyAccessLevel

java.lang.Object
java.lang.Enum<PropertyAccessLevel>
nl.pim16aap2.animatedarchitecture.core.structures.properties.PropertyAccessLevel
All Implemented Interfaces:
Serializable, Comparable<PropertyAccessLevel>, Constable

public enum PropertyAccessLevel extends Enum<PropertyAccessLevel>
Represents the access level of a property.

This determines to what extent a user can interact with the property.

  • Enum Constant Details

    • NONE

      public static final PropertyAccessLevel 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

      public static final PropertyAccessLevel 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

      public static final PropertyAccessLevel EDIT
      The property is editable by the user.

      The user can directly change the value of this property.

    • ADD

      public static final PropertyAccessLevel ADD
      The user can add this property to structures that do not yet have it.
    • REMOVE

      public static final PropertyAccessLevel REMOVE
      The user can remove this property from structures that have it.
  • Field Details

  • Method Details

    • values

      public static PropertyAccessLevel[] 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

      public static PropertyAccessLevel valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • hasFlags

      public static boolean hasFlags(int permissionFlag, PropertyAccessLevel... levels)
      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

      public static boolean hasFlags(int permissionFlag, Collection<PropertyAccessLevel> levels)
      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

      public static boolean hasOneFlagOf(int permissionFlag, PropertyAccessLevel... levels)
      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

      public static boolean hasOneFlagOf(int permissionFlag, Collection<PropertyAccessLevel> levels)
      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

      public static boolean hasFlag(int permissionFlag, PropertyAccessLevel level)
      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

      public static int getFlagOf(PropertyAccessLevel... levels)
      Returns the combined permission flag of the given access levels.
      Parameters:
      levels - The access levels to combine.
      Returns:
      The combined permission flag.
    • getFlagOf

      public static int getFlagOf(Collection<PropertyAccessLevel> levels)
      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()