/* * Copyright (c) 2015 Pantheon Technologies s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.model.ri.type; import static java.util.Objects.requireNonNull; import java.util.Collection; import java.util.Optional; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.Status; import org.opendaylight.yangtools.yang.model.api.TypeDefinition; import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode; abstract class AbstractRestrictedType> extends AbstractTypeDefinition { private final @NonNull T baseType; AbstractRestrictedType(final T baseType, final QName qname, final Collection unknownSchemaNodes) { super(qname, unknownSchemaNodes); this.baseType = requireNonNull(baseType); } @Override public final T getBaseType() { return baseType; } @Override public final Optional getUnits() { return baseType.getUnits(); } @Override public final Optional getDefaultValue() { return baseType.getDefaultValue(); } @Override public final Optional getDescription() { return baseType.getDescription(); } @Override public final Optional getReference() { return baseType.getReference(); } @Override public final Status getStatus() { return baseType.getStatus(); } }