com.hextremelabs.quickee.cache.inifinispan.NullValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quickee Show documentation
Show all versions of quickee Show documentation
A utility Java EE development library
/*
* JBoss, Home of Professional Open Source
* Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.hextremelabs.quickee.cache.inifinispan;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
/**
* A placeholder value for storing {@literal null} in a cache.
*
* @author Olaf Bergner
* @since 5.3
*/
final class NullValue implements Serializable {
/**
* The serialVersionUID
*/
private static final long serialVersionUID = 6104836300055942197L;
static final NullValue NULL = new NullValue();
/**
* Create a new NullValue.
*
*/
private NullValue() {
// Intentionally left blank
}
public static class Externalizer implements Serializable {
/**
* The serialVersionUID
*/
private static final long serialVersionUID = -6374308529927819177L;
/**
* @param output
* @param object
* @throws IOException
* @see org.infinispan.marshall.Externalizer#writeObject(java.io.ObjectOutput, java.lang.Object)
*/
public void writeObject(ObjectOutput output, NullValue object) throws IOException {
// Nothing to do?
}
/**
* @param input
* @return
* @throws IOException
* @throws ClassNotFoundException
* @see org.infinispan.marshall.Externalizer#readObject(java.io.ObjectInput)
*/
public NullValue readObject(ObjectInput input) throws IOException, ClassNotFoundException {
return NullValue.NULL;
}
}
}