/* * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.sal.binding.test; import static org.junit.Assert.assertNotNull; import org.opendaylight.yangtools.yang.binding.Augmentable; import org.opendaylight.yangtools.yang.binding.Augmentation; public class AugmentationVerifier> { private T object; public AugmentationVerifier(T objectToVerify) { this.object = objectToVerify; } public AugmentationVerifier assertHasAugmentation(Class> augmentation) { assertHasAugmentation(object, augmentation); return (AugmentationVerifier) this; } public static > void assertHasAugmentation(T object, Class> augmentation) { assertNotNull(object); assertNotNull("Augmentation " + augmentation.getSimpleName() + " is not present.", object.getAugmentation(augmentation)); } public static > AugmentationVerifier from(T obj) { return new AugmentationVerifier(obj); } }