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

org.djutils.data.serialization.StringSerializer Maven / Gradle / Ivy

The newest version!
package org.djutils.data.serialization;

/**
 * StringSerializer (de)serializes String objects.
 * 

* Copyright (c) 2020-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 * @author Peter Knoppers * @author Wouter Schakel */ public class StringSerializer implements SpecificTextSerializer { /** {@inheritDoc} */ @Override public String serialize(final String value, final String unit) { return value == null ? null : value.toString(); } /** {@inheritDoc} */ @Override public String deserialize(final Class type, final String text, final String unit) { return (text == null || text.isEmpty()) ? null : text; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy