These objects are used heavily, make sure we share instances.
Change-Id: I81fd8cac22d5f32643e58199ede545b909934100
Signed-off-by: Robert Varga <rovarga@cisco.com>
public final class ActionConvertor {
private static final Logger LOG = LoggerFactory.getLogger(ActionConvertor.class);
private static final String UNKNOWN_ACTION_TYPE_VERSION = "Unknown Action Type for the Version";
+ private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> ACTION_ORDERING =
+ Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>build());
private ActionConvertor() {
// NOOP
Action ofAction;
final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> sortedActions =
- Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>build())
- .sortedCopy(actions);
+ ACTION_ORDERING.sortedCopy(actions);
for (int actionItem = 0; actionItem < sortedActions.size(); actionItem++) {
ofAction = null;
*/
public static final List<MatchEntry> DEFAULT_MATCH_ENTRIES = new ArrayList<MatchEntry>();
+ private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> INSTRUCTION_ORDERING =
+ Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction>build());
+
private static final VlanMatch VLAN_MATCH_FALSE;
private static final VlanMatch VLAN_MATCH_TRUE;
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions instructions = flow.getInstructions();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> sortedInstructions =
- Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction>build())
- .sortedCopy(instructions.getInstruction());
+ INSTRUCTION_ORDERING.sortedCopy(instructions.getInstruction());
for (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction instruction : sortedInstructions) {
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curInstruction = instruction
*/
public class TableFeaturesConvertor {
private static final Logger LOG = LoggerFactory.getLogger(TableFeaturesConvertor.class);
+ private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties> TABLE_FEATURE_PROPS_ORDERING =
+ Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties>build());
private TableFeaturesConvertor() {
//hiding implicit construcotr
List<TableFeatureProperties> ofTablePropertiesList = new ArrayList<>();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties>
- sortedTableProperties =
- Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties>build())
- .sortedCopy(tableProperties.getTableFeatureProperties());
+ sortedTableProperties = TABLE_FEATURE_PROPS_ORDERING.sortedCopy(tableProperties.getTableFeatureProperties());
for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties
property : sortedTableProperties) {