Class BoolValue

java.lang.Object
com.iohao.net.framework.protocol.wrapper.BoolValue

@ProtobufClass public final class BoolValue extends Object
Protocol wrapper for a single boolean value.

Wraps a primitive boolean for protobuf serialization, allowing it to be used as a parameter or return type in @ActionMethod handlers. Instances for true and false are cached and reused via the factory methods.

Author:
渔民小镇
date:
2023-02-07
  • Field Details

    • value

      @Protobuf(fieldType=BOOL, order=1) public boolean value
  • Constructor Details

    • BoolValue

      public BoolValue()
  • Method Details

    • of

      public static BoolValue of(boolean value)
      Return a cached BoolValue for the given boolean.
      Parameters:
      value - the boolean value
      Returns:
      the cached BoolValue instance
    • ofTrue

      public static BoolValue ofTrue()
      Return the cached BoolValue for true.
      Returns:
      the true BoolValue instance
    • ofFalse

      public static BoolValue ofFalse()
      Return the cached BoolValue for false.
      Returns:
      the false BoolValue instance
    • toString

      public String toString()
      Overrides:
      toString in class Object