blob: 36f3a3a1c044806b0fca9c651dcdbd2df238612b [file] [log] [blame]
Sean Condon0e89bda2017-03-21 14:23:19 +00001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.drivers.microsemi.yang.utils;
17
18import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitloopback.transmitloopbackinput.TargetAddress;
19import org.onosproject.yang.gen.v1.mseasoamfm.rev20160229.mseasoamfm.mefcfm.maintenancedomain.maintenanceassociation.maintenanceassociationendpoint.AugmentedMseaCfmMaintenanceAssociationEndPoint;
20import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.targetaddressgroup.addresstype.MepId;
21import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.mefcfm.maintenancedomain.maintenanceassociation.MaintenanceAssociationEndPoint;
22import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.targetaddressgroup.addresstype.MacAddress;
23import org.onosproject.yang.gen.v1.mseasoamfm.rev20160229.mseasoamfm.mefcfm.maintenancedomain.maintenanceassociation.maintenanceassociationendpoint.DefaultAugmentedMseaCfmMaintenanceAssociationEndPoint;
24
25/**
26 * This is a workaround for Checkstyle issue.
27 * https://github.com/checkstyle/checkstyle/issues/3850
28 *
29 */
30public final class MepIdUtil2 {
31 private MepIdUtil2() {
32 //Hidden
33 }
34
35 public static MepId convertTargetAddrToMepId(TargetAddress targetMep) {
36 return (MepId) targetMep.addressType();
37 }
38
39 public static MacAddress convertTargetAddrToMacAddress(TargetAddress targetMep) {
40 return (MacAddress) targetMep.addressType();
41 }
42
43 public static AugmentedMseaCfmMaintenanceAssociationEndPoint
44 convertFmAugmentedMep(MaintenanceAssociationEndPoint mep) {
45 return (AugmentedMseaCfmMaintenanceAssociationEndPoint) mep
46 .augmentation(DefaultAugmentedMseaCfmMaintenanceAssociationEndPoint.class);
47 }
48}