Class ServiceTemplate

  • All Implemented Interfaces:
    de.dytanic.cloudnet.common.INameable, SerializableObject

    public class ServiceTemplate
    extends java.lang.Object
    implements de.dytanic.cloudnet.common.INameable, SerializableObject
    Defines the location of a template for services that can either be copied into a service or filled from a service by using a ServiceDeployment. CloudNet's default storage is "local".
    • Constructor Detail

      • ServiceTemplate

        public ServiceTemplate​(java.lang.String prefix,
                               java.lang.String name,
                               java.lang.String storage)
      • ServiceTemplate

        public ServiceTemplate​(java.lang.String prefix,
                               java.lang.String name,
                               java.lang.String storage,
                               boolean alwaysCopyToStaticServices)
      • ServiceTemplate

        public ServiceTemplate()
    • Method Detail

      • local

        public static ServiceTemplate local​(java.lang.String prefix,
                                            java.lang.String name)
      • parse

        public static ServiceTemplate parse​(java.lang.String template)
        Parses a template out of a string in the following format: storage:prefix/name "storage:" is optional, only "prefix/name" needs to be provided

        alwaysCopyToStaticServices will always be false in the returned ServiceTemplate.

        Parameters:
        template - the template in the specified format
        Returns:
        the parsed ServiceTemplate or null if the format was invalid
      • parseArray

        @NotNull
        public static @NotNull ServiceTemplate[] parseArray​(java.lang.String templates)
        Parses multiple templates out of a string in the format specified for parse(String) split by ";".
        Parameters:
        templates - the templates in the specified format
        Returns:
        an array of the parsed templates, this will not contain any null elements if any format is wrong
      • shouldAlwaysCopyToStaticServices

        public boolean shouldAlwaysCopyToStaticServices()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getTemplatePath

        public java.lang.String getTemplatePath()
      • getPrefix

        public java.lang.String getPrefix()
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface de.dytanic.cloudnet.common.INameable
      • getStorage

        public java.lang.String getStorage()