Package cdc.enums

Class AbstractDynamicEnumSupport<V>

Type Parameters:
V - The dynamic enum type.
All Implemented Interfaces:
DagType<V>, DynamicEnumSupport<V>, EnumType<V>, ListType<V>

public abstract class AbstractDynamicEnumSupport<V> extends AbstractBaseDagSupport<V> implements DynamicEnumSupport<V>
Base class for dynamic enum support.
Author:
Damien Carbonne
  • Field Details

    • nameValidator

      protected final Predicate<String> nameValidator
    • DEFAULT_NAME_VALIDATOR

      public static final Predicate<String> DEFAULT_NAME_VALIDATOR
  • Constructor Details

  • Method Details

    • isLocked

      public final boolean isLocked()
      Description copied from interface: ListType
      Returns true when modifications are disabled.

      A static implementation is always locked.
      After locking a dynamic implementation, it is impossible to unlock it.

      Specified by:
      isLocked in interface ListType<V>
      Returns:
      true when modifications (creation, removal, ...) are disabled.
    • lock

      public void lock()
      Description copied from interface: DynamicEnumSupport
      Definitely locks modifications.
      Specified by:
      lock in interface DynamicEnumSupport<V>
    • checkNameIsValid

      protected final void checkNameIsValid(String name)
    • checkIsUnlocked

      protected final void checkIsUnlocked()
    • checkHasNoSiblingNamed

      protected final void checkHasNoSiblingNamed(V value, String name)