Interface DataStoreFactory<C>

    • Method Detail

      • forType

        static @Nullable DataStoreFactory<?> forType​(String type)
        Get a factory for the type identifier.

        The type identifier is not case-sensitive.

        Parameters:
        type - requested type
        Returns:
        a factory, or null if none is available.
      • friendlyName

        net.kyori.adventure.text.Component friendlyName()
        A user-visible name for this data store type.
        Returns:
        the data store type name
      • name

        String name()
        The name for the data store type, usable for lookup.
        Returns:
        data store type name
        Since:
        2.0.0
      • create

        ProtoDataStore<Ccreate​(String identifier,
                                 org.spongepowered.configurate.ConfigurationNode config)
                          throws PermissionsLoadingException
        Create a new proto data-store.

        The returned instance will have its configuration validated, but will not attempt to load any data until it is defrosted.

        Parameters:
        identifier - the identifier for this specific data store instance.
        config - options used to configure the data store
        Returns:
        a new data store instance, not yet loaded
        Throws:
        PermissionsLoadingException - if any of the configuration options are invalid
        Since:
        2.0.0
      • serialize

        void serialize​(org.spongepowered.configurate.ConfigurationNode node,
                       ProtoDataStore<C> protoStore)
                throws org.spongepowered.configurate.serialize.SerializationException
        Write the configuration defined by the proto-store to a node.
        Parameters:
        node - the destination for the configuration
        protoStore - the data store
        Throws:
        org.spongepowered.configurate.serialize.SerializationException - if unable to write data fully
        Since:
        2.0.0