diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2016-09-23 16:39:09 +0200 |
---|---|---|
committer | Jan Srnicek <jsrnicek@cisco.com> | 2016-09-23 16:41:57 +0200 |
commit | 60d69218642cc976fa606fd8a38623d8c035dd86 (patch) | |
tree | a0ccb089d93198ff7c9974eaf3e39e44a1a1f06d /vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/AbstractInterfaceTypeCustomizer.java | |
parent | 08cd3ae5fd61d60ec07996179146c956459c084f (diff) |
HONEYCOMB-145 - Utility Class Refactoring
problematic mockito-all changed to mockito-core( https://github.com/mockito/mockito/issues/324)
Translate Utils Splitted to multiple Trait Interfaces
Ipv4Translator - Logic for translation of ipv4-based data
Ipv6Translator - Logic for translation of ipv6-based data
MacTranslator - Logic for translation of mac-based data
AddressTranslator - Aggregation trait for Ipv4/Ipv6/Mac
JvppReplyConsumer - Logic for extracting replies from jvpp calls
ByteDataTranslator - any byte-based conversions
Plus some existing utility classes changed to traits
Change-Id: I342b625954223966802e65dca0fabf8456c89345
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/AbstractInterfaceTypeCustomizer.java')
-rw-r--r-- | vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/AbstractInterfaceTypeCustomizer.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/AbstractInterfaceTypeCustomizer.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/AbstractInterfaceTypeCustomizer.java index dd66f7225..35eb1ad40 100644 --- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/AbstractInterfaceTypeCustomizer.java +++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/AbstractInterfaceTypeCustomizer.java @@ -35,7 +35,7 @@ import org.openvpp.jvpp.core.future.FutureJVppCore; * Validates the type of interface. */ public abstract class AbstractInterfaceTypeCustomizer<D extends DataObject> - extends FutureJVppCustomizer implements WriterCustomizer<D> { + extends FutureJVppCustomizer implements WriterCustomizer<D> { protected AbstractInterfaceTypeCustomizer(final FutureJVppCore futureJVppCore) { super(futureJVppCore); @@ -46,13 +46,13 @@ public abstract class AbstractInterfaceTypeCustomizer<D extends DataObject> final InstanceIdentifier<Interface> ifcTypeFromIid = id.firstIdentifierOf(Interface.class); checkArgument(ifcTypeFromIid != null, "Instance identifier does not contain {} type", Interface.class); checkArgument(id.firstKeyOf(Interface.class) != null, "Instance identifier does not contain keyed {} type", - Interface.class); + Interface.class); final Optional<Interface> interfaceConfig = writeContext.readAfter(ifcTypeFromIid); checkState(interfaceConfig.isPresent(), - "Unable to get Interface configuration for an interface: %s currently being updated", ifcTypeFromIid); + "Unable to get Interface configuration for an interface: %s currently being updated", ifcTypeFromIid); IllegalInterfaceTypeException - .checkInterfaceType(interfaceConfig.get(), getExpectedInterfaceType()); + .checkInterfaceType(interfaceConfig.get(), getExpectedInterfaceType()); } protected abstract Class<? extends InterfaceType> getExpectedInterfaceType(); @@ -62,14 +62,14 @@ public abstract class AbstractInterfaceTypeCustomizer<D extends DataObject> */ @Override public final void writeCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D dataAfter, - @Nonnull final WriteContext writeContext) throws WriteFailedException { + @Nonnull final WriteContext writeContext) throws WriteFailedException { checkProperInterfaceType(writeContext, id); writeInterface(id, dataAfter, writeContext); } protected abstract void writeInterface(final InstanceIdentifier<D> id, final D dataAfter, final WriteContext writeContext) - throws WriteFailedException; + throws WriteFailedException; // Validation for update and delete is not necessary @@ -91,8 +91,8 @@ public abstract class AbstractInterfaceTypeCustomizer<D extends DataObject> @Nonnull final Class<? extends InterfaceType> expectedType) { if (ifc.getType() == null || !expectedType.equals(ifc.getType())) { throw new IllegalInterfaceTypeException(String.format( - "Unexpected interface type: %s for interface: %s. Expected interface is: %s", ifc.getType(), - ifc.getName(), expectedType)); + "Unexpected interface type: %s for interface: %s. Expected interface is: %s", ifc.getType(), + ifc.getName(), expectedType)); } } |