Class UIModule.ClassDefinitionBuilder

java.lang.Object
com.hypixel.hytale.server.core.modules.ui.UIModule.ClassDefinitionBuilder
Enclosing class:
UIModule

public static final class UIModule.ClassDefinitionBuilder extends Object
Fluent builder for a view model class definition. Obtain an instance via UIModule.defineClass(String).

Part of an upcoming feature that is still in development and not yet ready for production use. Do not use. The API is not final and may change.

  • Method Details

    • extendsType

      @Nonnull public UIModule.ClassDefinitionBuilder extendsType(@Nonnull String baseTypeName)
      Sets the base type this class inherits from, so it also exposes the base type's properties. The base type must itself be registered. Calling this again replaces the previous base type.

      Part of an upcoming feature that is still in development and not yet ready for production use. Do not use. The API is not final and may change.

      Parameters:
      baseTypeName - The fully qualified base type name; must start with "Server.".
      Returns:
      this builder
    • prop

      @Nonnull public UIModule.ClassDefinitionBuilder prop(@Nonnull String name, @Nonnull String type)
      Adds a property to the class. A repeated name overwrites the previously declared type. Use UITypes constants (or a static import of it) for the type string. Type can be a primitive type, a native Noesis type, or a dynamic class type. If the type is a dynamic class type, it must be registered beforehand, as registration order matters.

      Part of an upcoming feature that is still in development and not yet ready for production use. Do not use. The API is not final and may change.

      Parameters:
      name - The property name as referenced from XAML bindings.
      type - The property type string, e.g. a UITypes constant.
      Returns:
      this builder
    • register

      public boolean register()
      Commits the definition. On success, sends it to all online players. Registration is a no-op if the type name is invalid, already registered, or the base type is not yet registered, which is logged as a warning.

      Part of an upcoming feature that is still in development and not yet ready for production use. Do not use. The API is not final and may change.

      Returns:
      whether registration was successful