Class MutableBool

java.lang.Object
com.luna.common.mutable.MutableBool
All Implemented Interfaces:
Mutable<Boolean>, Serializable, Comparable<MutableBool>

public class MutableBool extends Object implements Comparable<MutableBool>, Mutable<Boolean>, Serializable
可变 boolean 类型
Since:
3.0.1
See Also:
  • Constructor Details

    • MutableBool

      public MutableBool()
      构造,默认值0
    • MutableBool

      public MutableBool(boolean value)
      构造
      Parameters:
      value - 值
    • MutableBool

      public MutableBool(String value) throws NumberFormatException
      构造
      Parameters:
      value - String值
      Throws:
      NumberFormatException - 转为Boolean错误
  • Method Details

    • get

      public Boolean get()
      Description copied from interface: Mutable
      获得原始值
      Specified by:
      get in interface Mutable<Boolean>
      Returns:
      原始值
    • set

      public void set(boolean value)
      设置值
      Parameters:
      value - 值
    • set

      public void set(Boolean value)
      Description copied from interface: Mutable
      设置值
      Specified by:
      set in interface Mutable<Boolean>
      Parameters:
      value - 值
    • equals

      public boolean equals(Object obj)
      相等需同时满足如下条件:
      1. 非空
      2. 类型为 MutableBool
      3. 值相等
      Overrides:
      equals in class Object
      Parameters:
      obj - 比对的对象
      Returns:
      相同返回true,否则 false
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(MutableBool other)
      比较
      Specified by:
      compareTo in interface Comparable<MutableBool>
      Parameters:
      other - 其它 MutableBool 对象
      Returns:
      x==y返回0,x<y返回-1,x>y返回1
    • toString

      public String toString()
      Overrides:
      toString in class Object