Class BasicSerializer<T>

java.lang.Object
org.djutils.serialization.serializers.BasicSerializer<T>
Type Parameters:
T - class
All Implemented Interfaces:
Serializer<T>
Direct Known Subclasses:
ArrayOrMatrixSerializer, ArrayOrMatrixWithUnitSerializer, BasicPrimitiveArrayOrMatrixSerializer, ObjectSerializer

public abstract class BasicSerializer<T> extends Object implements Serializer<T>
Basics of the serializer

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

Author:
Alexander Verbraeck, Peter Knoppers
  • Constructor Details

    • BasicSerializer

      public BasicSerializer(byte type, String dataClassName)
      Construct the BasicSerializer.
      Parameters:
      type - byte; the field type (returned by the fieldType method)
      dataClassName - String; returned by the dataClassName method
  • Method Details

    • fieldType

      public final byte fieldType()
      Description copied from interface: Serializer
      Return the byte representation of the field type.
      Specified by:
      fieldType in interface Serializer<T>
      Returns:
      byte
    • dataClassName

      public final String dataClassName()
      Description copied from interface: Serializer
      Return a description of the type of data that this serializer handles. The result of this method should not be subject to localization because it is used in the SerialDataDecoder to identify the type of a serializer.
      Specified by:
      dataClassName in interface Serializer<T>
      Returns:
      String; description of the type of data that this serializer handles
    • toString

      public String toString()
      Overrides:
      toString in class Object