2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.impl.codec;
10 import static com.google.common.base.Preconditions.checkArgument;
12 import org.opendaylight.yangtools.yang.common.Empty;
13 import org.opendaylight.yangtools.yang.data.api.codec.EmptyCodec;
14 import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition;
16 final class EmptyStringCodec extends TypeDefinitionAwareCodec<Empty, EmptyTypeDefinition>
17 implements EmptyCodec<String> {
18 static final EmptyStringCodec INSTANCE = new EmptyStringCodec();
20 private EmptyStringCodec() {
21 super(null, Empty.class);
25 protected Empty deserializeImpl(final String product) {
26 checkArgument(product.isEmpty(), "The value must be empty");
31 protected String serializeImpl(final Empty input) {