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;
10 import java.util.List;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
14 * Common parent class for numeric byte operands.
16 * @param <N> numeric operand type
18 abstract class AbstractNumericByteOperandParser<N, V extends Number> extends AbstractNumericOperandParser<N> {
21 public final <T extends N> String toString(final List<T> list) {
22 final StringBuilder buffer = new StringBuilder();
23 boolean isFirst = true;
24 for (final T item : list) {
25 buffer.append(super.toString(getOp(item), isFirst));
26 buffer.append(getValue(item));
32 return buffer.toString();
35 abstract <T extends N> V getValue(final T item);
37 abstract <T extends N> NumericOperand getOp(final T item);