Package space.arim.dazzleconf.backend
Class KeyPath.Mut
java.lang.Object
space.arim.dazzleconf.backend.KeyPath
space.arim.dazzleconf.backend.KeyPath.Mut
- All Implemented Interfaces:
Printable
- Enclosing class:
KeyPath
-
Nested Class Summary
Nested classes/interfaces inherited from class space.arim.dazzleconf.backend.KeyPath
KeyPath.Immut, KeyPath.Mut, KeyPath.SequenceBoundaryNested classes/interfaces inherited from interface space.arim.dazzleconf.backend.Printable
Printable.Abstract -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBack(@NonNull CharSequence part) Adds a key part at the back.voidaddFront(@NonNull CharSequence part) Adds a key part at the front.voidaddPath(@NonNull KeyPath.SequenceBoundary boundary, @NonNull KeyPath toAdd) Adds another key path to this one, either at the front or back of this key path.voidapplyKeyMapper(@NonNull KeyMapper keyMapper) Applies a key mapper to existing key parts.@NonNull KeyPath.ImmutGets this key path as an immutable one.@NonNull KeyPath.MutintoMut()Gets this key path as a mutable one.Methods inherited from class space.arim.dazzleconf.backend.KeyPath
empty, equals, forEach, getLeading, hashCode, intoParts, intoPartsList, isEmpty, iterateFrom, printString, printTo, printTo, size, toString
-
Constructor Details
-
Mut
public Mut()Creates an empty key path -
Mut
Creates from the given parts- Parameters:
parts- the parts
-
Mut
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
Description copied from class:KeyPathGets 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.
-
intoImmut
Description copied from class:KeyPathGets this key path as an immutable one.The data contained within this
KeyPathis 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. -
applyKeyMapper
Applies a key mapper to existing key parts.All existing key parts will be mapped through the provided argument. Parts added later will not be affected.
- Parameters:
keyMapper- the key mapper
-
addFront
Adds a key part at the front.This part will be prepended before the other parts.
- Parameters:
part- the part
-
addBack
Adds a key part at the back.This part will be appended behind the other parts.
- Parameters:
part- the part
-
addPath
Adds another key path to this one, either at the front or back of this key path.- Parameters:
boundary- where to add the key path; should it be prepended at the front, or appended at the backtoAdd- that which is added to this one
-