Class KeyPath.Immut

java.lang.Object
space.arim.dazzleconf.backend.KeyPath
space.arim.dazzleconf.backend.KeyPath.Immut
All Implemented Interfaces:
Printable
Enclosing class:
KeyPath

public static final class KeyPath.Immut extends KeyPath
A key path which is unmistakably immutable.
  • Constructor Details

    • Immut

      public Immut()
      Creates an empty key path
    • Immut

      public Immut(@NonNull String @NonNull ... parts)
      Creates from the given parts
      Parameters:
      parts - the parts
    • Immut

      public Immut(@NonNull KeyPath other)
      Creates from another key path.

      This will copy the parts of that key path into this one.

      Parameters:
      other - the other key path
  • Method Details

    • intoMut

      public @NonNull KeyPath.Mut intoMut()
      Description copied from class: KeyPath
      Gets this key path as a mutable one.

      If not mutable, the data is copied to a new key path which is returned. This copying may be performed lazily, such as by deferring to the first mutative operation on the returned object.

      Specified by:
      intoMut in class KeyPath
      Returns:
      this key path if mutable, or a mutable copy if needed
    • intoImmut

      public @NonNull KeyPath.Immut intoImmut()
      Description copied from class: KeyPath
      Gets this key path as an immutable one.

      The data contained within this KeyPath is moved to an immutable instance. The old instance may still be used, but the implementation of this method may be optimized for the case that it is not.

      If this instance is already DataTree.Immut, then it may be returned without changes.

      Specified by:
      intoImmut in class KeyPath
      Returns:
      an immutable key path