All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vladsch.flexmark.experimental.util.data.CollectionDataKey Maven / Gradle / Ivy

Go to download

Contains experimental classes that may or may not work in all cases. Use at your own risk.

The newest version!
package com.vladsch.flexmark.experimental.util.data;

import com.vladsch.flexmark.util.data.DataKey;
import com.vladsch.flexmark.util.data.DataNotNullValueFactory;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

public class CollectionDataKey extends DataKey> {
    /**
     * Creates a DataKey with a computed default value dynamically.
     *
     * @param name    See {@link #getName()}.
     * @param defaultValue default value for collection key
     * @param factory data value factory for creating a new default value for the key
     */
    public CollectionDataKey(@NotNull String name, @NotNull Collection defaultValue, DataNotNullValueFactory> factory) {
        super(name, defaultValue, factory);
    }

    @NotNull
    public DataNotNullValueFactory> getFactory() {
        return super.getFactory();
    }

    @Override
    public String toString() {
        Collection defaultValue = getDefaultValue();
        return "CollectionDataKey<" + defaultValue.getClass().getSimpleName() + "> " + getName();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy