com.kaka.util.mutable.Mutable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kaka-core Show documentation
Show all versions of kaka-core Show documentation
An event driven framework
The newest version!
package com.kaka.util.mutable;
import java.io.Serializable;
/**
* @author zkpursuit
*/
public class Mutable implements Serializable {
private T value;
public Mutable() {
}
public Mutable(T value) {
this.value = value;
}
public T get() {
return value;
}
public void set(T value) {
this.value = value;
}
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (this == obj) {
return true;
}
if (this.getClass() == obj.getClass()) {
Mutable> that = (Mutable>) obj;
return this.value.equals(that.value);
}
return false;
}
public int hashCode() {
return this.value == null ? 0 : this.value.hashCode();
}
public String toString() {
return this.value == null ? "null" : this.value.toString();
}
}