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.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.yang.common.Empty;
14 import org.opendaylight.yangtools.yang.data.api.codec.EmptyCodec;
15 import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition;
17 final class EmptyStringCodec extends TypeDefinitionAwareCodec<Empty, EmptyTypeDefinition>
18 implements EmptyCodec<String> {
19 static final EmptyStringCodec INSTANCE = new EmptyStringCodec();
21 private EmptyStringCodec() {
22 super(null, Empty.class);
26 protected Empty deserializeImpl(final String product) {
27 checkArgument(product.isEmpty(), "The value must be empty");
28 return Empty.getInstance();
32 protected @NonNull String serializeImpl(final Empty input) {