package org.djutils.data.serialization;
/**
* BooleanSerializer (de)serializes Boolean objects.
*
* Copyright (c) 2020-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
* for project information https://djutils.org. The DJUTILS project is
* distributed under a three-clause BSD-style license, which can be found at
* https://djutils.org/docs/license.html.
* @author Alexander Verbraeck
* @author Peter Knoppers
* @author Wouter Schakel
*/
public class BooleanSerializer implements TextSerializer
{
/** {@inheritDoc} */
@Override
public String serialize(final Object value)
{
return String.valueOf(((Boolean) value).booleanValue());
}
/** {@inheritDoc} */
@Override
public Boolean deserialize(final String text)
{
return Boolean.valueOf(text);
}
}