MutableBoolean.java 1.96 KB
package org.apache.commons.lang3.mutable;

import java.io.Serializable;
import org.apache.commons.lang3.BooleanUtils;

public class MutableBoolean
  implements Serializable, Comparable<MutableBoolean>, Mutable<Boolean>
{
  private static final long serialVersionUID = -4830728138360036487L;
  private boolean a;
  
  public MutableBoolean() {}
  
  public MutableBoolean(Boolean paramBoolean)
  {
    this.a = paramBoolean.booleanValue();
  }
  
  public MutableBoolean(boolean paramBoolean)
  {
    this.a = paramBoolean;
  }
  
  public boolean booleanValue()
  {
    return this.a;
  }
  
  public int compareTo(MutableBoolean paramMutableBoolean)
  {
    return BooleanUtils.compare(this.a, paramMutableBoolean.a);
  }
  
  public boolean equals(Object paramObject)
  {
    boolean bool2 = false;
    boolean bool1 = bool2;
    if ((paramObject instanceof MutableBoolean))
    {
      bool1 = bool2;
      if (this.a == ((MutableBoolean)paramObject).booleanValue()) {
        bool1 = true;
      }
    }
    return bool1;
  }
  
  public Boolean getValue()
  {
    return Boolean.valueOf(this.a);
  }
  
  public int hashCode()
  {
    if (this.a) {
      return Boolean.TRUE.hashCode();
    }
    return Boolean.FALSE.hashCode();
  }
  
  public boolean isFalse()
  {
    return !this.a;
  }
  
  public boolean isTrue()
  {
    return this.a == true;
  }
  
  public void setFalse()
  {
    this.a = false;
  }
  
  public void setTrue()
  {
    this.a = true;
  }
  
  public void setValue(Boolean paramBoolean)
  {
    this.a = paramBoolean.booleanValue();
  }
  
  public void setValue(boolean paramBoolean)
  {
    this.a = paramBoolean;
  }
  
  public Boolean toBoolean()
  {
    return Boolean.valueOf(booleanValue());
  }
  
  public String toString()
  {
    return String.valueOf(this.a);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/org/apache/commons/lang3/mutable/MutableBoolean.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */