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.protocol.bgp.flowspec.handlers;
10 import java.util.List;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.NumericOperand;
15 * Common parent class for numeric byte operands.
17 * @param <N> numeric operand type
19 abstract class AbstractNumericByteOperandParser<N, V extends Number> extends AbstractNumericOperandParser<N> {
22 public final <T extends N> String toString(final List<T> list) {
23 final StringBuilder buffer = new StringBuilder();
24 boolean isFirst = true;
25 for (final T item : list) {
26 buffer.append(super.toString(getOp(item), isFirst));
27 buffer.append(getValue(item));
33 return buffer.toString();
36 abstract <T extends N> V getValue(final T item);
38 abstract <T extends N> NumericOperand getOp(final T item);