All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.polaris.core.lang.Null Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package io.polaris.core.lang;

import java.io.ObjectStreamException;
import java.io.Serializable;

/**
 * @author Qt
 * @since 1.8
 */
public class Null implements Serializable {

	private static final long serialVersionUID = 1L;
	private static final Null INSTANCE = new Null();

	private Null() {
	}

	public static Null getInstance() {
		return INSTANCE;
	}

	@Override
	public boolean equals(Object obj) {
		return obj == null || this == obj;
	}

	@Override
	public String toString() {
		return "null";
	}

	private Object readResolve() throws ObjectStreamException {
		return Null.INSTANCE;
	}

//	private Object writeReplace() throws ObjectStreamException {
//		return Null.instance;
//	}
//
//	private void writeObject(java.io.ObjectOutputStream out) throws IOException {
//		out.defaultWriteObject();
//	}
//
//	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
//		in.defaultReadObject();
//	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy