Class ConfigurationTransformation.VersionedBuilder

    • Method Detail

      • versionKey

        public ConfigurationTransformation.VersionedBuilder versionKey​(java.lang.Object... versionKey)
        Sets the path of the version key within the configuration.
        Parameters:
        versionKey - the path to the version key
        Returns:
        this builder (for chaining)
        Since:
        4.0.0
      • addVersion

        public @NonNull ConfigurationTransformation.VersionedBuilder addVersion​(int version,
                                                                                @NonNull ConfigurationTransformation transformation)
        Adds a transformation to this builder for the given version.

        The version must be between 0 and Integer.MAX_VALUE, and a version cannot be specified multiple times.

        Parameters:
        version - the version
        transformation - the transformation
        Returns:
        this builder (for chaining)
        Since:
        4.0.0
      • addVersion

        public @NonNull ConfigurationTransformation.VersionedBuilder addVersion​(int version,
                                                                                @NonNull ConfigurationTransformation... transformations)
        Adds a new series of transformations for a version.

        The version must be between 0 and Integer.MAX_VALUE.

        Parameters:
        version - the version
        transformations - the transformations. To perform a version upgrade, these transformations will be executed in order.
        Returns:
        this builder
        Since:
        4.0.0
      • makeVersion

        public @NonNull ConfigurationTransformation.VersionedBuilder makeVersion​(int version,
                                                                                 @NonNull java.util.function.Consumer<? super ConfigurationTransformation.Builder> maker)
        Create and add a new transformation to this builder.

        The transformation will be created from the builder passed to the callback function

        The version must be between 0 and Integer.MAX_VALUE

        Parameters:
        version - the version
        maker - the transformation
        Returns:
        this builder
        Since:
        4.0.0