Class Ui.ObjBuilder

java.lang.Object
com.hypixel.hytale.server.core.modules.ui.Ui.ObjBuilder
Enclosing class:
Ui

public static final class Ui.ObjBuilder extends Object
Fluent builder for a UIObjectDataValue. Obtain via Ui.obj(String). Primitive put overloads wrap values with the matching Ui factory. The byte overload uses Ui.byteVal(byte) (signed).
  • Method Details

    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, @Nonnull UIDataValue value)
      Sets a property to an existing data value.
      Parameters:
      name - property name as declared on the view-model type
      value - data value to store
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, @Nonnull String value)
      Sets a string property. Equivalent to put(String, UIDataValue) with Ui.stringVal(String).
      Parameters:
      name - property name
      value - string value
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, @Nonnull FormattedMessage value)
      Sets a formatted-message property.
      Parameters:
      name - property name
      value - formatted message
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, @Nonnull Message value)
      Sets a formatted-message property from a Message.
      Parameters:
      name - property name
      value - server message
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, @Nonnull CommandDefinition command)
      Sets an ICommand property from a registered CommandDefinition.
      Parameters:
      name - property name
      command - definition returned by UISurface.registerCommand(String, UICommandHandler)
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, @Nonnull Color c)
      Sets a Color property from a protocol Color (full opacity).
      Parameters:
      name - property name
      c - protocol color
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, @Nonnull ColorAlpha c)
      Sets a Color property from a protocol ColorAlpha.
      Parameters:
      name - property name
      c - protocol color with alpha
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, boolean value)
      Sets a boolean property.
      Parameters:
      name - property name
      value - boolean value
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, int value)
      Sets an int property.
      Parameters:
      name - property name
      value - int value
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, short value)
      Sets a short property.
      Parameters:
      name - property name
      value - short value
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, byte value)
      Sets a signed byte property via Ui.byteVal(byte). For unsigned channels use put(String, UIDataValue) with Ui.ubyteVal(byte).
      Parameters:
      name - property name
      value - signed byte value
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, long value)
      Sets a long property.
      Parameters:
      name - property name
      value - long value
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, float value)
      Sets a float property.
      Parameters:
      name - property name
      value - float value
      Returns:
      this builder
    • put

      @Nonnull public Ui.ObjBuilder put(@Nonnull String name, double value)
      Sets a double property.
      Parameters:
      name - property name
      value - double value
      Returns:
      this builder
    • build

      @Nonnull public UIObjectDataValue build()
      Builds the object data value from the accumulated properties.
      Returns:
      the completed UIObjectDataValue