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

org.djutils.serialization.serializers.BasicSerializer Maven / Gradle / Ivy

There is a newer version: 2.2.2
Show newest version
package org.djutils.serialization.serializers;

/**
 * Basics of the serializer
 * 

* Copyright (c) 2019-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See DJUTILS License. *

* @version $Revision$, $LastChangedDate$, by $Author$,
* @author Alexander Verbraeck * @author Peter Knoppers * @param class */ public abstract class BasicSerializer implements Serializer { /** The field type that usually prefixes the serialized data. */ private final byte type; /** String returned by the dataClassName method. */ private final String dataClassName; /** * Construct the BasicSerializer. * @param type byte; the field type (returned by the fieldType method) * @param dataClassName String; returned by the dataClassName method */ public BasicSerializer(final byte type, final String dataClassName) { this.type = type; this.dataClassName = dataClassName; } /** {@inheritDoc} */ @Override public final byte fieldType() { return this.type; } /** {@inheritDoc} */ @Override public final String dataClassName() { return this.dataClassName; } /** {@inheritDoc} */ @Override public String toString() { return "BasicSerializer [type=" + this.type + ", dataClassName=" + this.dataClassName + "]"; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy